本文整理汇总了Java中com.liferay.portal.model.Layout.getTypeSettingsProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Layout.getTypeSettingsProperties方法的具体用法?Java Layout.getTypeSettingsProperties怎么用?Java Layout.getTypeSettingsProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.model.Layout
的用法示例。
在下文中一共展示了Layout.getTypeSettingsProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLayout
import com.liferay.portal.model.Layout; //导入方法依赖的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;
}
示例2: fixTypeSettings
import com.liferay.portal.model.Layout; //导入方法依赖的package包/类
protected void fixTypeSettings(Layout layout) throws Exception {
if (!layout.isTypeURL()) {
return;
}
UnicodeProperties typeSettings = layout.getTypeSettingsProperties();
String url = GetterUtil.getString(typeSettings.getProperty("url"));
String friendlyURLPrivateGroupPath =
PropsValues.LAYOUT_FRIENDLY_URL_PRIVATE_GROUP_SERVLET_MAPPING;
String friendlyURLPrivateUserPath =
PropsValues.LAYOUT_FRIENDLY_URL_PRIVATE_USER_SERVLET_MAPPING;
String friendlyURLPublicPath =
PropsValues.LAYOUT_FRIENDLY_URL_PUBLIC_SERVLET_MAPPING;
if (!url.startsWith(friendlyURLPrivateGroupPath) &&
!url.startsWith(friendlyURLPrivateUserPath) &&
!url.startsWith(friendlyURLPublicPath)) {
return;
}
int x = url.indexOf(CharPool.SLASH, 1);
if (x == -1) {
return;
}
int y = url.indexOf(CharPool.SLASH, x + 1);
if (y == -1) {
return;
}
String friendlyURL = url.substring(x, y);
if (!friendlyURL.equals(LayoutExporter.SAME_GROUP_FRIENDLY_URL)) {
return;
}
Group group = layout.getGroup();
typeSettings.setProperty(
"url",
url.substring(0, x) + group.getFriendlyURL() + url.substring(y));
}
示例3: importJournalArticle
import com.liferay.portal.model.Layout; //导入方法依赖的package包/类
protected void importJournalArticle(
PortletDataContext portletDataContext, Layout layout,
Element layoutElement)
throws Exception {
UnicodeProperties typeSettingsProperties =
layout.getTypeSettingsProperties();
String articleId = typeSettingsProperties.getProperty(
"article-id", StringPool.BLANK);
if (Validator.isNull(articleId)) {
return;
}
JournalPortletDataHandlerImpl.importReferencedData(
portletDataContext, layoutElement);
Element structureElement = layoutElement.element("structure");
if (structureElement != null) {
JournalPortletDataHandlerImpl.importStructure(
portletDataContext, structureElement);
}
Element templateElement = layoutElement.element("template");
if (templateElement != null) {
JournalPortletDataHandlerImpl.importTemplate(
portletDataContext, templateElement);
}
Element articleElement = layoutElement.element("article");
if (articleElement != null) {
JournalPortletDataHandlerImpl.importArticle(
portletDataContext, articleElement);
}
Map<String, String> articleIds =
(Map<String, String>)portletDataContext.getNewPrimaryKeysMap(
JournalArticle.class + ".articleId");
articleId = MapUtil.getString(articleIds, articleId, articleId);
typeSettingsProperties.setProperty("article-id", articleId);
JournalContentSearchLocalServiceUtil.updateContentSearch(
portletDataContext.getScopeGroupId(), layout.isPrivateLayout(),
layout.getLayoutId(), StringPool.BLANK, articleId, true);
}