当前位置: 首页>>代码示例>>Java>>正文


Java LayoutLocalServiceUtil.addLayout方法代码示例

本文整理汇总了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);
}
 
开发者ID:ngriffin7a,项目名称:portletbox,代码行数:10,代码来源:ServiceUtil.java

示例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;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:64,代码来源:ParticityInitializer.java


注:本文中的com.liferay.portal.service.LayoutLocalServiceUtil.addLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。