List of usage examples for com.liferay.portal.kernel.template TemplateConstants TEMPLATE_ID
String TEMPLATE_ID
To view the source code for com.liferay.portal.kernel.template TemplateConstants TEMPLATE_ID.
Click Source Link
From source file:com.liferay.dynamic.data.lists.web.internal.template.DDLDisplayTemplateTransformer.java
License:Open Source License
public String transform() throws Exception { Transformer transformer = TransformerHolder.getTransformer(); Map<String, Object> contextObjects = new HashMap<>(); contextObjects.put(DDLConstants.RESERVED_DDM_STRUCTURE_ID, _recordSet.getDDMStructureId()); contextObjects.put(DDLConstants.RESERVED_DDM_TEMPLATE_ID, _ddmTemplateId); contextObjects.put(DDLConstants.RESERVED_RECORD_SET_DESCRIPTION, _recordSet.getDescription(_themeDisplay.getLocale())); contextObjects.put(DDLConstants.RESERVED_RECORD_SET_ID, _recordSet.getRecordSetId()); contextObjects.put(DDLConstants.RESERVED_RECORD_SET_NAME, _recordSet.getName(_themeDisplay.getLocale())); contextObjects.put(TemplateConstants.TEMPLATE_ID, _ddmTemplateId); String viewMode = Constants.VIEW; if (_renderRequest != null) { viewMode = ParamUtil.getString(_renderRequest, "viewMode", Constants.VIEW); }//from www. j a v a2 s . com contextObjects.put("viewMode", viewMode); DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.getTemplate(_ddmTemplateId); contextObjects.put(TemplateConstants.CLASS_NAME_ID, ddmTemplate.getClassNameId()); TemplateManager templateManager = TemplateManagerUtil.getTemplateManager(ddmTemplate.getLanguage()); TemplateHandler templateHandler = TemplateHandlerRegistryUtil .getTemplateHandler(DDLRecordSet.class.getName()); templateManager.addContextObjects(contextObjects, templateHandler.getCustomContextObjects()); templateManager.addTaglibSupport(contextObjects, PortalUtil.getHttpServletRequest(_renderRequest), _themeDisplay.getResponse()); return transformer.transform(_themeDisplay, contextObjects, ddmTemplate.getScript(), ddmTemplate.getLanguage(), new UnsyncStringWriter()); }