@Override public AssetEntry getAssetEntry(String className, long classPK) throws PortalException, SystemException { LayoutRevision layoutRevision = LayoutRevisionLocalServiceUtil.getLayoutRevision(classPK); LayoutSetBranch layoutSetBranch = LayoutSetBranchLocalServiceUtil.getLayoutSetBranch(layoutRevision.getLayoutSetBranchId()); User user = UserLocalServiceUtil.getUserById(layoutRevision.getUserId()); AssetEntry assetEntry = AssetEntryLocalServiceUtil.createAssetEntry(classPK); assetEntry.setGroupId(layoutRevision.getGroupId()); assetEntry.setCompanyId(user.getCompanyId()); assetEntry.setUserId(user.getUserId()); assetEntry.setUserName(user.getFullName()); assetEntry.setCreateDate(layoutRevision.getCreateDate()); assetEntry.setClassNameId(PortalUtil.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()); return assetEntry; }
@Override public AssetRenderer getAssetRenderer(long layoutRevisionId, int type) throws PortalException, SystemException { LayoutRevision layoutRevision = LayoutRevisionLocalServiceUtil.getLayoutRevision(layoutRevisionId); LayoutRevisionAssetRenderer layoutRevisionAssetRenderer = new LayoutRevisionAssetRenderer(layoutRevision); layoutRevisionAssetRenderer.setAssetRendererType(type); return layoutRevisionAssetRenderer; }
protected LayoutRevision getLayoutRevision() throws Exception { Layout layout = LayoutTestUtil.addLayout(_group, false); ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(); LayoutSetBranch layoutSetBranch = LayoutSetBranchLocalServiceUtil.addLayoutSetBranch( TestPropsValues.getUserId(), _group.getGroupId(), false, RandomTestUtil.randomString(), RandomTestUtil.randomString(), true, 0, serviceContext); LayoutBranch layoutBranch = LayoutBranchLocalServiceUtil.getMasterLayoutBranch( layoutSetBranch.getLayoutSetBranchId(), layout.getPlid()); return LayoutRevisionLocalServiceUtil.getLayoutRevision( layoutSetBranch.getLayoutSetBranchId(), layoutBranch.getLayoutBranchId(), layout.getPlid()); }