本文整理汇总了Java中com.liferay.portal.service.LayoutLocalServiceUtil.importLayouts方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutLocalServiceUtil.importLayouts方法的具体用法?Java LayoutLocalServiceUtil.importLayouts怎么用?Java LayoutLocalServiceUtil.importLayouts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.service.LayoutLocalServiceUtil
的用法示例。
在下文中一共展示了LayoutLocalServiceUtil.importLayouts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultSiteTemplate
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public void createDefaultSiteTemplate(long companyId) throws PortalException, SystemException
{
boolean exists = false;
long layoutSetPrototypeId = 0;
for(LayoutSetPrototype lay:LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototypes(0, LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototypesCount())){
if(lay.getCompanyId() == companyId && "course".equals(lay.getName(LocaleUtil.getDefault()))) {
exists=true;
layoutSetPrototypeId = lay.getLayoutSetPrototypeId();
}
}
if(!exists){
long defaultUserId = UserLocalServiceUtil.getDefaultUserId(companyId);
Map<Locale, String> nameMap = new HashMap<Locale, String>();
nameMap.put(LocaleUtil.getDefault(), "course");
layoutSetPrototype = LayoutSetPrototypeLocalServiceUtil.addLayoutSetPrototype(defaultUserId, companyId, nameMap, "course", true,true,new ServiceContext());
InputStream larStream=this.getClass().getClassLoader().getResourceAsStream("/course.lar");
LayoutLocalServiceUtil.importLayouts(defaultUserId,layoutSetPrototype.getGroup().getGroupId() ,
layoutSetPrototype.getLayoutSet().isPrivateLayout(), getLayoutSetPrototypeParameters(), larStream);
} else {
layoutSetPrototype = LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(layoutSetPrototypeId);
}
}
示例2: importResources
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public void importResources() throws Exception {
if (_privateLARInputStream != null) {
LayoutLocalServiceUtil.importLayouts(
userId, groupId, true, getParameterMap(),
_privateLARInputStream);
}
if (_publicLARInputStream != null) {
LayoutLocalServiceUtil.importLayouts(
userId, groupId, false, getParameterMap(),
_publicLARInputStream);
}
}