本文整理汇总了Java中com.liferay.portal.service.LayoutLocalServiceUtil.addLayout方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutLocalServiceUtil.addLayout方法的具体用法?Java LayoutLocalServiceUtil.addLayout怎么用?Java LayoutLocalServiceUtil.addLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.service.LayoutLocalServiceUtil
的用法示例。
在下文中一共展示了LayoutLocalServiceUtil.addLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLayout
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public static Layout addLayout(long userId, long groupId, boolean privateLayout, long parentLayoutId, String name,
String title, String description, String type, boolean hidden, String friendlyURL) throws Exception {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(groupId);
return LayoutLocalServiceUtil.addLayout(userId, groupId, privateLayout, parentLayoutId, name, title,
description, type, hidden, friendlyURL, serviceContext);
}
示例2: createLayout
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public static Layout createLayout(long adminId, long companyId, long groupId, E_ContextPath path, String actualPath) {
Layout result = null;
boolean privateLayout = false;
String description = null;
String type = path.getType();
long parentLayoutId = path.isHidden() ? homeLayoutId : LayoutConstants.DEFAULT_PARENT_LAYOUT_ID;
ServiceContext ctx = new ServiceContext();
if (actualPath == null)
actualPath = path.getPath();
try {
result = LayoutLocalServiceUtil.addLayout(adminId, groupId,
privateLayout, parentLayoutId, path.getName(), path.getTitle(), description,
type, path.isHidden(), actualPath, ctx);
// layout.setLayoutPrototypeLinkEnabled(false);
if (!type.equals(LayoutConstants.TYPE_URL)) {
Theme theme = getTheme(companyId, path.getThemeId());
if (theme != null) {
result.setThemeId(path.getThemeId());
result = LayoutLocalServiceUtil.updateLookAndFeel(groupId,
false, result.getLayoutId(), path.getThemeId(), "01", "", false);
} else
m_objLog.warn("Did not find theme: " + path.getThemeId() + " for url "
+ path.getPath());
LayoutTemplate template = getLayoutTemplate(path.getTemplateId());
LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) result
.getLayoutType();
if (template != null) {
layoutTypePortlet.setLayoutTemplateId(0, path.getTemplateId(), false);
m_objLog.debug("Set layout template: "
+ template.getLayoutTemplateId() + " for url "
+ path.getPath());
} else
m_objLog.warn("Did not find layout template: " + path.getTemplateId()
+ " for url " + path.getPath());
} else {
// set the value of the "link to page"
UnicodeProperties props = result.getTypeSettingsProperties();
props.put( "url", path.getTitle() );
result.setTypeSettingsProperties( props );
LayoutLocalServiceUtil.updateLayout( result ); //
}
m_objLog.debug("Added layout for url " + actualPath + ", group: "
+ groupId + ", company: " + companyId + ", user: "
+ adminId);
updatePermissions(result, path);
} catch (Throwable t) {
m_objLog.error(t);
}
return result;
}