Tag Archives: webcontent

Play With Structure/Template In Liferay

Hi All, When we are creating a structure for a webcontent with some name, then some time we require to get structureId of that structure programmatically. Below is the sample code for that: private String getStructureId() { String STRUCTUREID = null; try { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(JournalStructure.class, PortalClassLoaderUtil.getClassLoader()).add(PropertyFactoryUtil. forName(“name”).like(“%YOUR_STRUCTURE_NAME_HERE%”)); List structures = JournalStructureLocalServiceUtil.dynamicQuery(dynamicQuery, 0, 1); […]