Example usage for com.liferay.portal.kernel.model LayoutRevision getHTMLTitle

List of usage examples for com.liferay.portal.kernel.model LayoutRevision getHTMLTitle

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model LayoutRevision getHTMLTitle.

Prototype

public String getHTMLTitle(String localeLanguageId);

Source Link

Usage

From source file:com.liferay.layout.admin.web.internal.asset.LayoutRevisionAssetRendererFactory.java

License:Open Source License

@Override
public AssetEntry getAssetEntry(String className, long classPK) throws PortalException {

    LayoutRevision layoutRevision = _layoutRevisionLocalService.getLayoutRevision(classPK);

    LayoutSetBranch layoutSetBranch = _layoutSetBranchLocalService
            .getLayoutSetBranch(layoutRevision.getLayoutSetBranchId());

    User user = _userLocalService.getUserById(layoutRevision.getUserId());

    AssetEntry assetEntry = _assetEntryLocalService.createAssetEntry(classPK);

    assetEntry.setGroupId(layoutRevision.getGroupId());
    assetEntry.setCompanyId(user.getCompanyId());
    assetEntry.setUserId(user.getUserId());
    assetEntry.setUserName(user.getFullName());
    assetEntry.setCreateDate(layoutRevision.getCreateDate());
    assetEntry.setClassNameId(_portal.getClassNameId(LayoutRevision.class.getName()));
    assetEntry.setClassPK(layoutRevision.getLayoutRevisionId());

    StringBundler sb = new StringBundler(4);

    sb.append(layoutRevision.getHTMLTitle(LocaleUtil.getSiteDefault()));
    sb.append(" [");
    sb.append(layoutSetBranch.getName());
    sb.append("]");

    assetEntry.setTitle(sb.toString());// ww  w .ja  v  a 2  s  .c o  m

    return assetEntry;
}