本文整理汇总了Java中com.liferay.portal.model.LayoutTypePortletConstants类的典型用法代码示例。如果您正苦于以下问题:Java LayoutTypePortletConstants类的具体用法?Java LayoutTypePortletConstants怎么用?Java LayoutTypePortletConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutTypePortletConstants类属于com.liferay.portal.model包,在下文中一共展示了LayoutTypePortletConstants类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addLayoutColumnPortlet
import com.liferay.portal.model.LayoutTypePortletConstants; //导入依赖的package包/类
protected void addLayoutColumnPortlet(
Layout layout, String columnId, JSONObject portletJSONObject)
throws Exception {
LayoutTypePortlet layoutTypePortlet =
(LayoutTypePortlet)layout.getLayoutType();
String rootPortletId = portletJSONObject.getString("portletId");
if (Validator.isNull(rootPortletId)) {
throw new ImporterException("portletId is not specified");
}
String portletId = layoutTypePortlet.addPortletId(
userId, rootPortletId, columnId, -1, false);
JSONObject portletPreferencesJSONObject =
portletJSONObject.getJSONObject("portletPreferences");
if ((portletPreferencesJSONObject == null) ||
(portletPreferencesJSONObject.length() == 0)) {
return;
}
PortletPreferences portletSetup =
PortletPreferencesFactoryUtil.getLayoutPortletSetup(
layout, portletId);
Iterator<String> iterator = portletPreferencesJSONObject.keys();
while (iterator.hasNext()) {
String key = iterator.next();
String value = portletPreferencesJSONObject.getString(key);
if (rootPortletId.equals(PortletKeys.JOURNAL_CONTENT) &&
key.equals("articleId")) {
value = getJournalId(value);
}
portletSetup.setValue(key, value);
}
portletSetup.store();
if (rootPortletId.equals(PortletKeys.NESTED_PORTLETS)) {
JSONArray columnsJSONArray =
portletPreferencesJSONObject.getJSONArray("columns");
StringBundler sb = new StringBundler(4);
sb.append(StringPool.UNDERLINE);
sb.append(portletId);
sb.append(StringPool.DOUBLE_UNDERLINE);
sb.append(LayoutTypePortletConstants.COLUMN_PREFIX);
addLayoutColumns(layout, sb.toString(), columnsJSONArray);
}
}
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:62,代码来源:FileSystemImporter.java
示例2: addLayoutTemplate
import com.liferay.portal.model.LayoutTypePortletConstants; //导入依赖的package包/类
protected void addLayoutTemplate(InputStream inputStream) throws Exception {
String content = StringUtil.read(inputStream);
if (Validator.isNull(content)) {
return;
}
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(content);
JSONObject layoutTemplateJSONObject = jsonObject.getJSONObject(
"layoutTemplate");
String name = getName(layoutTemplateJSONObject.getString("name"));
LayoutPrototype layoutPrototype = getLayoutPrototype(companyId, name);
if (layoutPrototype != null) {
if (!developerModeEnabled) {
if (_log.isInfoEnabled()) {
_log.info(
"Layout prototype with name " + name +
" already exists for company " + companyId);
}
return;
}
LayoutPrototypeLocalServiceUtil.deleteLayoutPrototype(
layoutPrototype);
}
layoutPrototype =
LayoutPrototypeLocalServiceUtil.addLayoutPrototype(
userId, companyId, getMap(name), name, true, serviceContext);
JSONArray columnsJSONArray = layoutTemplateJSONObject.getJSONArray(
"columns");
Layout layout = layoutPrototype.getLayout();
addLayoutColumns(
layout, LayoutTypePortletConstants.COLUMN_PREFIX, columnsJSONArray);
LayoutLocalServiceUtil.updateLayout(
layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId(),
layout.getTypeSettings());
}
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:48,代码来源:FileSystemImporter.java
注:本文中的com.liferay.portal.model.LayoutTypePortletConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论