Created
February 16, 2019 17:55
-
-
Save CorneAussems/f5c6b80dfc8e7ddd65b87c1ea053832d to your computer and use it in GitHub Desktop.
Groovy Liferay 7 get all Layouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.kernel.service.*; | |
try{ | |
companyId = 5015832 | |
def start = -1 | |
def end = -1 | |
def privateLayout = false; | |
groups = GroupLocalServiceUtil.getGroups(start,end); | |
println('groups found='+groups.size()+ groups[0]) | |
for(i=0;i<groups.size();i++){ | |
def group = groups[i]; | |
if(group.getCompanyId()==companyId){ | |
//println( group ); | |
def layouts = LayoutLocalServiceUtil.getLayouts(group.getGroupId(), privateLayout ) | |
println('layouts found='+layouts.size()) | |
for(i=0;i<layouts.size();i++){ | |
def layout = layouts[i]; | |
println( 'layout uuid='+layout.getUuid()+' url='+layout.getFriendlyURL() + ' name='+layout.getName() ); | |
} | |
} | |
} | |
} catch (Exception e) { | |
println(e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment