diff --git a/docker/k8s-aws-eks-manifest-examples/alb.yaml b/docker/k8s-aws-eks-manifest-examples/alb.yaml index 5a2d51a4db71..99172f738fb4 100644 --- a/docker/k8s-aws-eks-manifest-examples/alb.yaml +++ b/docker/k8s-aws-eks-manifest-examples/alb.yaml @@ -26,7 +26,7 @@ metadata: alb.ingress.kubernetes.io/backend-protocol: HTTP alb.ingress.kubernetes.io/healthcheck-protocol: HTTP alb.ingress.kubernetes.io/healthcheck-port: '8082' - alb.ingress.kubernetes.io/healthcheck-path: /api/v1/appconfiguration + alb.ingress.kubernetes.io/healthcheck-path: /api/v1/alive alb.ingress.kubernetes.io/healthcheck-interval-seconds: '30' alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' alb.ingress.kubernetes.io/success-codes: '200' diff --git a/docker/k8s-aws-eks-manifest-examples/statefulset.yaml b/docker/k8s-aws-eks-manifest-examples/statefulset.yaml index 753c352b03da..ea3ca66e90a7 100644 --- a/docker/k8s-aws-eks-manifest-examples/statefulset.yaml +++ b/docker/k8s-aws-eks-manifest-examples/statefulset.yaml @@ -102,7 +102,7 @@ spec: fi; ln -s /data/shared/assets/.backup /data/local/dotsecure/backup; startupProbe: httpGet: - path: /api/v1/appconfiguration + path: /api/v1/heavy port: 8082 initialDelaySeconds: 30 periodSeconds: 5 @@ -111,16 +111,16 @@ spec: timeoutSeconds: 1 livenessProbe: httpGet: - path: /api/v1/appconfiguration + path: /api/v1/light port: 8082 initialDelaySeconds: 1 periodSeconds: 30 successThreshold: 1 - failureThreshold: 1 + failureThreshold: 3 timeoutSeconds: 10 readinessProbe: httpGet: - path: /api/v1/appconfiguration + path: /api/v1/light port: 8082 initialDelaySeconds: 1 periodSeconds: 10 diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/maintenance/JVMInfoResource.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/maintenance/JVMInfoResource.java index b170a0dfecbf..05e138edf77a 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/maintenance/JVMInfoResource.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/maintenance/JVMInfoResource.java @@ -10,6 +10,16 @@ import com.dotmarketing.util.UtilMethods; import com.liferay.portal.util.ReleaseInfo; import io.vavr.control.Try; +import org.glassfish.jersey.server.JSONP; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import java.io.IOException; import java.io.Serializable; import java.lang.management.ManagementFactory; @@ -20,23 +30,18 @@ import java.util.Map; import java.util.Properties; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import org.glassfish.jersey.server.JSONP; - @Path("/v1/jvm") @SuppressWarnings("serial") public class JVMInfoResource implements Serializable { + private static final String DEFAULT_OBFUSCATE_PATTERN = "passw|pass|passwd|secret|key|token"; + + public static final Pattern obfuscateBasePattern = Pattern.compile(DEFAULT_OBFUSCATE_PATTERN, + Pattern.CASE_INSENSITIVE); + public static final Pattern obfuscatePattern = Pattern.compile( - Config.getStringProperty("OBFUSCATE_SYSTEM_ENVIRONMENTAL_VARIABLES", "passw|pass|passwd|secret|key|token"), + Config.getStringProperty("OBFUSCATE_SYSTEM_ENVIRONMENTAL_VARIABLES", DEFAULT_OBFUSCATE_PATTERN), Pattern.CASE_INSENSITIVE); @Path("/") @@ -187,7 +192,9 @@ private Map getReleaseInfo(){ public static String obfuscateIfNeeded(final String key, final Object valueObject) { final String value = (String) valueObject; if(UtilMethods.isEmpty(value)) return ""; - return obfuscatePattern.matcher(key).find() ? obfuscate(value) : value; + return obfuscateBasePattern.matcher(key).find() || obfuscatePattern.matcher(key).find() + ? obfuscate(value) + : value; } private static String obfuscate(final String value) { diff --git a/dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java b/dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java index 2125bc4faa03..a19c8ac2f5ef 100644 --- a/dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java +++ b/dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java @@ -57,6 +57,13 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) try { doFilterInternal(req, res, chain); + } catch (Exception e) { + if (e.getClass().getCanonicalName().contains("ClientAbortException")) { + Logger.info(this.getClass(), "ClientAbortException: " + ((HttpServletRequest) req).getRequestURI()); + Logger.debug(this.getClass(), "ClientAbortException: " + e.getMessage()); + } else { + throw e; + } } finally { DbConnectionFactory.closeSilently(); } diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/init.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/init.jsp deleted file mode 100644 index 20d60e5efe29..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/init.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<% -/** - * Copyright (c) 2000-2002 Liferay Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -%> - -<%@ include file="/html/common/init.jsp" %> - - \ No newline at end of file diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/sub_nav.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/sub_nav.jsp deleted file mode 100644 index 7bde1ba11f27..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/sub_nav.jsp +++ /dev/null @@ -1,2 +0,0 @@ -<%@ include file="/html/portlet/ext/contentlet/init.jsp" %> - diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_container.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_container.jsp deleted file mode 100644 index 830252ba13b4..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_container.jsp +++ /dev/null @@ -1,108 +0,0 @@ -<%@ include file="/html/portlet/ext/director/init.jsp" %> - -<%@ page import="com.dotmarketing.portlets.containers.model.Container" %> -<%@ page import="com.dotmarketing.factories.InodeFactory" %> -<%@ page import="com.dotmarketing.util.UtilMethods" %> - - -<% -Container container; -if (request.getAttribute(com.dotmarketing.util.WebKeys.CONTAINER_EDIT)!=null) { - container = (Container) request.getAttribute(com.dotmarketing.util.WebKeys.CONTAINER_EDIT); -} -else { - container = (Container) com.dotmarketing.factories.InodeFactory.getInode(request.getParameter("inode"),Container.class); -} -String referer = (request.getParameter("referer") != null ) ? java.net.URLDecoder.decode(request.getParameter("referer"),"UTF-8") : ""; -%> -<%@page import="com.dotmarketing.util.DateUtil"%> -<%@page import="java.util.HashMap"%> -
" method="post" id="fm"> - - - - - - - - " /> - - -<% - String userName= "unknown"; - String userFullName= "unknown"; - try{ - com.liferay.portal.model.User userMod = com.liferay.portal.ejb.UserManagerUtil.getUserById(container.getModUser()); - userName = userMod.getEmailAddress(); - userFullName = userMod.getFullName(); - } - catch(Exception e){ - - } - - SimpleDateFormat sdf = new SimpleDateFormat("h:mm aa, MMMM d?, yyyy"); - String modDate = sdf.format(container.getModDate()); - modDate = modDate.replaceAll("\\?", "th"); - String sinceMessage = ""; - HashMap diffDates = DateUtil.diffDates(container.getModDate(), new Date()); - if (0 < diffDates.get(DateUtil.DIFF_YEARS)) { - sinceMessage = LanguageUtil.get(pageContext, "more-than-a-year-ago"); - } else if (48 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "2-days-ago"); - } else if (24 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "1-day-ago--") + modDate + ")."; - } else if (8 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" " +LanguageUtil.get(pageContext, "hours-ago--") + modDate + ")."; - } else if (1 <= diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" "+ LanguageUtil.get(pageContext, "hour-s--and") + diffDates.get(DateUtil.DIFF_MINUTES) + " " +LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } else if (diffDates.get(DateUtil.DIFF_HOURS) < 1) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_MINUTES)+" " + LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } -%> - -
-

<%= LanguageUtil.get(pageContext, "Alert") %>

-

<%= LanguageUtil.format(pageContext, "locked-asset-message", new LanguageWrapper[]{new LanguageWrapper("", "Container", ""), new LanguageWrapper("", userName, ""), new LanguageWrapper("", userFullName, ""), new LanguageWrapper("", sinceMessage, "")}) %>

-

<%= LanguageUtil.get(pageContext, "Would-you-like-to-unlock-it-to-proceed") %>

-
- <%= LanguageUtil.get(pageContext, "Title") %>: - <%=container.getTitle()%>
- - <%= LanguageUtil.get(pageContext, "Description") %>: - <%=container.getFriendlyName()%> -
-
 
-
- - -
-
- -
- -
- - - - - - - - - diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_contentlet.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_contentlet.jsp deleted file mode 100644 index 46447d1d3a9e..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_contentlet.jsp +++ /dev/null @@ -1,138 +0,0 @@ -<%@ include file="/html/portlet/ext/director/init.jsp" %> - -<%@ page import="com.dotmarketing.portlets.contentlet.model.Contentlet" %> -<%@ page import="com.dotmarketing.portlets.containers.model.Container" %> -<%@ page import="com.dotmarketing.util.UtilMethods" %> - -<% -Contentlet contentlet; -if (request.getAttribute(com.dotmarketing.util.WebKeys.CONTENTLET_EDIT)!=null) { - contentlet = (Contentlet) request.getAttribute(com.dotmarketing.util.WebKeys.CONTENTLET_EDIT); -} -else { - ContentletAPI contentletAPI = APILocator.getContentletAPI(); - contentlet = (Contentlet) contentletAPI.find(request.getParameter("inode"), user, true); - -} -String assetName ="Contentlet"; -try{ -Structure s = contentlet.getStructure(); - assetName = s.getName(); -} -catch(Exception e){ - if(contentlet != null){ - Logger.debug(this, "Contentlet "+ contentlet.getInode() + " does not know its structure"); - } - else{ - Logger.error(this, "Contentlet is null"); - } -} -String referer = (request.getParameter("referer") != null ) ? java.net.URLDecoder.decode(request.getParameter("referer"),"UTF-8") : ""; - -%> -<%@page import="com.dotmarketing.business.APILocator"%> -<%@page import="com.dotmarketing.portlets.contentlet.business.ContentletAPI"%> -<%@page import="com.dotmarketing.business.UserAPI"%> -<%@page import="com.dotmarketing.business.RoleAPI"%> -<%@page import="com.dotmarketing.business.VersionableAPI"%> -<%@page import="com.dotmarketing.util.DateUtil"%> -<%@page import="java.util.HashMap"%> -<%@page import="com.dotmarketing.portlets.structure.model.Structure"%> -<%@page import="com.dotmarketing.util.Logger"%> -
" method="post" id="fm"> - - - - - - - - - - " /> - - -<% - String userName= "unknown"; - String userFullName= "unknown"; - try{ - com.liferay.portal.model.User userMod = com.liferay.portal.ejb.UserManagerUtil.getUserById(contentlet.getModUser()); - userName = userMod.getEmailAddress(); - userFullName = userMod.getFullName(); - } - catch(Exception e){ - - } - - SimpleDateFormat sdf = new SimpleDateFormat("h:mm aa, MMMM d?, yyyy",LanguageUtil.getLocale(pageContext)); - String modDate = sdf.format(contentlet.getModDate()); - modDate = modDate.replaceAll("\\?", "th"); - String sinceMessage = ""; - HashMap diffDates = DateUtil.diffDates(contentlet.getModDate(), new Date()); - if (0 < diffDates.get(DateUtil.DIFF_YEARS)) { - sinceMessage = LanguageUtil.get(pageContext, "more-than-a-year-ago"); - } else if (48 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "2-days-ago"); - } else if (24 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "1-day-ago--") + modDate + ")."; - } else if (8 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" " +LanguageUtil.get(pageContext, "hours-ago--") + modDate + ")."; - } else if (1 <= diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" "+ LanguageUtil.get(pageContext, "hour-s--and") + diffDates.get(DateUtil.DIFF_MINUTES) + " " +LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } else if (diffDates.get(DateUtil.DIFF_HOURS) < 1) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_MINUTES)+" " + LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } - - User systemUser = APILocator.getUserAPI().getSystemUser(); - boolean isUserCMSAdmin = APILocator.getRoleAPI().doesUserHaveRole(user, APILocator.getRoleAPI().loadCMSAdminRole()); - String lockedUserId = APILocator.getVersionableAPI().getLockedBy(contentlet); -%> - -
-

<%= LanguageUtil.get(pageContext, "Alert") %>

-

<%= LanguageUtil.format(pageContext, "locked-asset-message", new LanguageWrapper[]{new LanguageWrapper("", "" + assetName + "", ""), new LanguageWrapper("", userName, ""), new LanguageWrapper("", userFullName, ""), new LanguageWrapper("", "
" + sinceMessage, "")}) %>

- <%if(user.getUserId().equals(systemUser.getUserId()) || isUserCMSAdmin || user.getUserId().equals(lockedUserId)){ %> -

<%= LanguageUtil.get(pageContext, "Would-you-like-to-unlock-it-to-proceed") %>

- <%} %> -
- <%= LanguageUtil.get(pageContext, "Title") %>: - <%=contentlet.getTitle()%>
- -
-
 
-
- <%if(user.getUserId().equals(systemUser.getUserId()) || isUserCMSAdmin || user.getUserId().equals(lockedUserId)){ %> - - <%} %> - -
-
- -
- -
- - - - - - - - - diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_htmlpage.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_htmlpage.jsp deleted file mode 100644 index f7ba8ba139da..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_htmlpage.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%@ include file="/html/portlet/ext/director/init.jsp" %> -<%@ page import="com.dotmarketing.util.UtilMethods" %> - -<%@ page import="com.dotmarketing.factories.InodeFactory" %> -<%@ page import="com.dotmarketing.util.UtilMethods" %> -<%@ page import="com.dotmarketing.portlets.htmlpageasset.model.IHTMLPage" %> - - -<% -IHTMLPage htmlPage; -if (request.getAttribute(com.dotmarketing.util.WebKeys.HTMLPAGE_EDIT)!=null) { - htmlPage = (IHTMLPage) request.getAttribute(com.dotmarketing.util.WebKeys.HTMLPAGE_EDIT); -} -else { - htmlPage = (IHTMLPage) com.dotmarketing.factories.InodeFactory.getInode(request.getParameter("inode"),IHTMLPage.class); -} -String referer = (request.getParameter("referer") != null ) ? java.net.URLDecoder.decode(request.getParameter("referer"),"UTF-8") : "" ; - -%> -<%@page import="com.dotmarketing.util.DateUtil"%> -<%@page import="java.util.HashMap"%> -
" method="post" id="fm"> - - - - - - - - " /> - - -<% - String userName= "unknown"; - String userFullName= "unknown"; - try{ - com.liferay.portal.model.User userMod = com.liferay.portal.ejb.UserManagerUtil.getUserById(htmlPage.getModUser()); - userName = userMod.getEmailAddress(); - userFullName = userMod.getFullName(); - } - catch(Exception e){ - - } - - SimpleDateFormat sdf = new SimpleDateFormat("h:mm aa, MMMM d?, yyyy"); - String modDate = sdf.format(htmlPage.getModDate()); - modDate = modDate.replaceAll("\\?", "th"); - String sinceMessage = ""; - HashMap diffDates = DateUtil.diffDates(htmlPage.getModDate(), new Date()); - if (0 < diffDates.get(DateUtil.DIFF_YEARS)) { - sinceMessage = LanguageUtil.get(pageContext, "more-than-a-year-ago"); - } else if (48 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "2-days-ago"); - } else if (24 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "1-day-ago--") + modDate + ")."; - } else if (8 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" " +LanguageUtil.get(pageContext, "hours-ago--") + modDate + ")."; - } else if (1 <= diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" "+ LanguageUtil.get(pageContext, "hour-s--and") + diffDates.get(DateUtil.DIFF_MINUTES) + " " +LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } else if (diffDates.get(DateUtil.DIFF_HOURS) < 1) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_MINUTES)+" " + LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } -%> - -
-

<%= LanguageUtil.get(pageContext, "Alert") %>

-

<%= LanguageUtil.format(pageContext, "locked-asset-message", new LanguageWrapper[]{new LanguageWrapper("", "HTML-Page", ""), new LanguageWrapper("", userName, ""), new LanguageWrapper("", userFullName, ""), new LanguageWrapper("", sinceMessage, "")}) %>

-

<%= LanguageUtil.get(pageContext, "Would-you-like-to-unlock-it-to-proceed") %>

-
- <%= LanguageUtil.get(pageContext, "Page-URL") %>: - <%=htmlPage.getPageUrl()%>
- - <%= LanguageUtil.get(pageContext, "Title") %>: - <%=htmlPage.getTitle()%>
- - <%= LanguageUtil.get(pageContext, "Description") %>: - <%=htmlPage.getFriendlyName()%> -
-
 
-
- - -
-
- -
- -
- - - - - - - - - diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_link.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_link.jsp deleted file mode 100644 index 641ffc11fe91..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/unlock_link.jsp +++ /dev/null @@ -1,112 +0,0 @@ -<%@ include file="/html/portlet/ext/director/init.jsp" %> - -<%@ page import="com.dotmarketing.portlets.links.model.Link" %> -<%@ page import="com.dotmarketing.factories.InodeFactory" %> -<%@ page import="com.dotmarketing.util.UtilMethods" %> - -<% -Link link; -if (request.getAttribute(com.dotmarketing.util.WebKeys.LINK_EDIT)!=null) { - link = (Link) request.getAttribute(com.dotmarketing.util.WebKeys.LINK_EDIT); -} -else { - link = (Link) com.dotmarketing.factories.InodeFactory.getInode(request.getParameter("inode"),Link.class); -} -String referer = (request.getParameter("referer") != null ) ? java.net.URLDecoder.decode(request.getParameter("referer"),"UTF-8") : ""; -%> -<%@page import="com.dotmarketing.util.DateUtil"%> -<%@page import="java.util.HashMap"%> -
" method="post" id="fm"> - - - -"> -"> - - - - - - " /> - - -<% - String userName= "unknown"; - String userFullName= "unknown"; - try{ - com.liferay.portal.model.User userMod = com.liferay.portal.ejb.UserManagerUtil.getUserById(link.getModUser()); - userName = userMod.getEmailAddress(); - userFullName = userMod.getFullName(); - } - catch(Exception e){ - - } - - SimpleDateFormat sdf = new SimpleDateFormat("h:mm aa, MMMM d?, yyyy"); - String modDate = sdf.format(link.getModDate()); - modDate = modDate.replaceAll("\\?", "th"); - String sinceMessage = ""; - HashMap diffDates = DateUtil.diffDates(link.getModDate(), new Date()); - if (0 < diffDates.get(DateUtil.DIFF_YEARS)) { - sinceMessage = LanguageUtil.get(pageContext, "more-than-a-year-ago"); - } else if (48 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "2-days-ago"); - } else if (24 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = LanguageUtil.get(pageContext, "1-day-ago--") + modDate + ")."; - } else if (8 < diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" " +LanguageUtil.get(pageContext, "hours-ago--") + modDate + ")."; - } else if (1 <= diffDates.get(DateUtil.DIFF_HOURS)) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_HOURS) +" "+ LanguageUtil.get(pageContext, "hour-s--and") + diffDates.get(DateUtil.DIFF_MINUTES) + " " +LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } else if (diffDates.get(DateUtil.DIFF_HOURS) < 1) { - sinceMessage = "" + diffDates.get(DateUtil.DIFF_MINUTES)+" " + LanguageUtil.get(pageContext, "minute-s--ago--") + modDate + ")."; - } -%> - -
-

<%= LanguageUtil.get(pageContext, "Alert") %>

-

<%= LanguageUtil.format(pageContext, "locked-asset-message", new LanguageWrapper[]{new LanguageWrapper("", "Link", ""), new LanguageWrapper("", userName, ""), new LanguageWrapper("", userFullName, ""), new LanguageWrapper("", sinceMessage, "")}) %>

-

<%= LanguageUtil.get(pageContext, "Would-you-like-to-unlock-it-to-proceed") %>

-
- <%= LanguageUtil.get(pageContext, "Title") %>: - <%=link.getTitle()%>
- - <%= LanguageUtil.get(pageContext, "URL") %>: - <%=link.getProtocal()%><%=link.getUrl()%> -
-
 
-
- - -
-
- -
- -
- - - - - - - - - diff --git a/dotCMS/src/main/webapp/html/portlet/ext/director/view.jsp b/dotCMS/src/main/webapp/html/portlet/ext/director/view.jsp deleted file mode 100644 index ad720d3d9ff0..000000000000 --- a/dotCMS/src/main/webapp/html/portlet/ext/director/view.jsp +++ /dev/null @@ -1,10 +0,0 @@ -<%@ include file="/html/portlet/ext/director/init.jsp" %> - - - - - -
- Directory -
<%= LanguageUtil.get(pageContext, "For-Dotmarketing-internal-use") %> -
\ No newline at end of file diff --git a/dotcms-integration/src/test/java/com/dotmarketing/util/UtilMethodsITest.java b/dotcms-integration/src/test/java/com/dotmarketing/util/UtilMethodsITest.java index 2ea510070739..c7e3639a9a4f 100644 --- a/dotcms-integration/src/test/java/com/dotmarketing/util/UtilMethodsITest.java +++ b/dotcms-integration/src/test/java/com/dotmarketing/util/UtilMethodsITest.java @@ -1,6 +1,8 @@ package com.dotmarketing.util; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import com.dotcms.util.IntegrationTestInitService; import com.dotmarketing.business.APILocator; @@ -61,4 +63,20 @@ public void test_dateToHTMLDate_USPacificTimeZone() } } + + + @Test + public void test_isSet_with_null_object() { + String obj=null; + assertFalse(UtilMethods.isSet(() -> obj.toString())); + } + + + @Test + public void test_isEmpty_with_null_object() { + String obj=null; + assertTrue(UtilMethods.isEmpty(() -> obj.toString())); + } + + }