Example usage for com.liferay.portal.kernel.template TemplateHandler getName

List of usage examples for com.liferay.portal.kernel.template TemplateHandler getName

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.template TemplateHandler getName.

Prototype

public String getName(Locale locale);

Source Link

Document

Returns the template handler's name.

Usage

From source file:com.liferay.dynamic.data.mapping.util.BaseDDMDisplay.java

License:Open Source License

@Override
public String getEditTemplateTitle(long classNameId, Locale locale) {
    if (classNameId > 0) {
        TemplateHandler templateHandler = TemplateHandlerRegistryUtil.getTemplateHandler(classNameId);

        if (templateHandler != null) {
            return LanguageUtil.get(locale, "new") + StringPool.SPACE + templateHandler.getName(locale);
        }/*from   w w w  .  j a  va2s .c om*/
    }

    return getDefaultEditTemplateTitle(locale);
}

From source file:com.liferay.portlet.display.template.web.internal.dynamic.data.mapping.util.PortletDisplayTemplateDDMDisplay.java

License:Open Source License

@Override
public String getTemplateType(DDMTemplate template, Locale locale) {
    String type = template.getType();

    if (!type.equals(DDMTemplateConstants.TEMPLATE_TYPE_DISPLAY)) {
        return type;
    }// www.j  a v  a  2s . c  o  m

    TemplateHandler templateHandler = TemplateHandlerRegistryUtil.getTemplateHandler(template.getClassNameId());

    return templateHandler.getName(locale);
}