Skip to content

Instantly share code, notes, and snippets.

View evaldeslacasa's full-sized avatar

Enrique Valdes Lacasa evaldeslacasa

  • Thirdwave LLC
  • Madrid
View GitHub Profile
@SubhashPavuskar
SubhashPavuskar / JSP Implicit Objects
Last active December 30, 2021 10:39
Available implicit objects Liferay JSP page
request (javax.servlet.ServletRequest)
response (javax.servlet.ServletResponse)
out (javax.servlet.jsp.JspWriter)
pageContext (javax.servlet.jsp.PageContext)
session (javax.servlet.http.HttpS)
application (javax.servlet.ServletContext)
config (javax.servlet.ServletConfig)
page (java.lang.Object)
exception (java.lang.Throwable)
@einsty
einsty / GroupUtil-getCurrentAndChildGroups.java
Created July 14, 2017 16:57
Utility method that can traverse the Liferay Group hierarchy and build an array of long representing all child groups. Useful in scoping a searchContext for content in an org hierarchy.
public static long[] getCurrentAndChildGroupIds(Group currentGroup){
try {
List<Long> theseChildGroupIds = new ArrayList<>();
theseChildGroupIds.add(currentGroup.getGroupId());
for (Group childGroup : currentGroup.getChildren(true)
) {
theseChildGroupIds.add(childGroup.getGroupId());
if(childGroup.getChildren(true).size() > 0){
for (Group grandChildGroup : childGroup.getChildren(true)