Skip to content

Instantly share code, notes, and snippets.

@evaldeslacasa
Last active November 3, 2015 23:29
Show Gist options
  • Select an option

  • Save evaldeslacasa/54ceef0e20c7d16f3bbd to your computer and use it in GitHub Desktop.

Select an option

Save evaldeslacasa/54ceef0e20c7d16f3bbd to your computer and use it in GitHub Desktop.
Dynamic Query to get Products page template
ClassLoader classLoader = PortalClassLoaderUtil.getClassLoader();
DynamicQuery templateQuery = DynamicQueryFactoryUtil.forClass(LayoutPrototype.class,classLoader)
.add(PropertyFactoryUtil.forName("name").like("%>Product<%"));
List<LayoutPrototype> templates = LayoutPrototypeLocalServiceUtil.dynamicQuery(templateQuery);
LayoutPrototype productsPageTemplate = templates.get(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment