本文整理汇总了Java中com.liferay.portal.service.LayoutLocalServiceUtil.fetchLayout方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutLocalServiceUtil.fetchLayout方法的具体用法?Java LayoutLocalServiceUtil.fetchLayout怎么用?Java LayoutLocalServiceUtil.fetchLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.service.LayoutLocalServiceUtil
的用法示例。
在下文中一共展示了LayoutLocalServiceUtil.fetchLayout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUsableJunctionPoints
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
@Override
public List<Layout> getUsableJunctionPoints(Layout layout) throws SystemException, PortalException {
long companyId = CompanyThreadLocal.getCompanyId();
long classNameId = ClassNameLocalServiceUtil.getClassNameId(Layout.class);
// Ermittle die Menge aller erlaubten GroupIds
Set<Long> usableGroupIds = getHierarchicalGroupIds(layout);
List<Layout> layouts = new ArrayList<Layout>();
List<ExpandoValue> values = ExpandoValueLocalServiceUtil.getColumnValues(companyId, classNameId,
ExpandoTableConstants.DEFAULT_TABLE_NAME, JUNCTION_POINT_LAYOUT, Boolean.TRUE.toString(), -1, -1);
for (ExpandoValue expandoValue : values) {
long classPK = expandoValue.getClassPK();
Layout jpLayout = LayoutLocalServiceUtil.fetchLayout(classPK);
if (jpLayout != null && usableGroupIds.contains(jpLayout.getGroupId())) {
layouts.add(jpLayout);
}
}
sortLayouts(layouts);
return layouts;
}
示例2: getJunctionPointRequest
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
protected HttpServletRequest getJunctionPointRequest(HttpServletRequest request) throws SystemException, PortalException {
long plid = ParamUtil.getLong(request, "p_l_id");
long sourceGroupId = ParamUtil.getLong(request, "p_v_l_s_g_id");
// falls keine layoutId angegeben ist oder aber bereits eine abweichende GroupId für ein
// VirtualLayout so wird nichts angepasst.
if (plid == GetterUtil.DEFAULT_LONG || sourceGroupId != GetterUtil.DEFAULT_LONG) {
return request;
}
Layout layout = LayoutLocalServiceUtil.fetchLayout(plid);
// Falls das Layout nicht existiert : nichts anpassen
if (layout == null) {
return request;
}
// Das Ziellayout anpassen, fass es ein JunctionPoint-Layout ist
Layout targetLayout = JunctionPointUtil.getJunctionTarget(layout, request, true);
// Das Top-Level-Layout unter Einbeziehung von JunctionPoints ermitteln
Layout ancestorLayout = JunctionPointUtil.getJunctionedAncestor(layout, request);
sourceGroupId = ancestorLayout.getGroupId();
// Zurück, falls es keine Anpassungen gibt
if (layout.getPlid() == targetLayout.getPlid() && layout.getGroupId() == sourceGroupId) {
return request;
}
return new JunctionPointRequest(request, targetLayout.getPlid(), sourceGroupId);
}
示例3: getConnectedLayouts
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
@Override
public List<Layout> getConnectedLayouts(Layout layout) throws SystemException {
long companyId = layout.getCompanyId();
Group group;
try {
group = layout.getGroup();
}
catch (PortalException e) {
// Behandlung einer PortalException
throw new RuntimeException(e);
}
String junctionPointKey = group.getUuid() + "/" + layout.getLayoutId();
long classNameId = ClassNameLocalServiceUtil.getClassNameId(Layout.class);
List<Layout> layouts = new ArrayList<Layout>();
List<ExpandoValue> values = ExpandoValueLocalServiceUtil.getColumnValues(companyId, classNameId,
ExpandoTableConstants.DEFAULT_TABLE_NAME, JUNCTION_POINT_CONNECTION, junctionPointKey, -1, -1);
for (ExpandoValue expandoValue : values) {
long classPK = expandoValue.getClassPK();
Layout connectedLayout = LayoutLocalServiceUtil.fetchLayout(classPK);
if (connectedLayout != null) {
layouts.add(connectedLayout);
}
}
sortLayouts(layouts);
return layouts;
}
示例4: getConfiguredJunctionPointLayout
import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
/**
* Lookup the configured junction point to be used instead of the given layout or null, if no
* junction point is configured at all.
*
* @param layout The layout that may have configured a junction point to be used
* @return The connected Layout or null
*/
@Override
public Layout getConfiguredJunctionPointLayout(Layout layout) {
// only top level layouts may use a junction point
if (layout.getParentLayoutId() != LayoutConstants.DEFAULT_PARENT_LAYOUT_ID) {
return null;
}
Layout junctionPointLayout = null;
// lookup the junction point configuration value
String configValue = (String) layout.getExpandoBridge().getAttribute(JUNCTION_POINT_CONNECTION, false);
if (Validator.isNotNull(configValue)) {
// the configuration consists of the group uuid and the layout id.
String[] configParts = configValue.split("/");
if (configParts.length == 2) {
Group group;
try {
group = GroupLocalServiceUtil.fetchGroupByUuidAndCompanyId(configParts[0], layout.getCompanyId());
long layoutId = GetterUtil.getLong(configParts[1]);
if (group != null && layoutId != GetterUtil.DEFAULT_LONG) {
junctionPointLayout = LayoutLocalServiceUtil.fetchLayout(group.getGroupId(), layout.getPrivateLayout(), layoutId);
}
}
catch (SystemException e) {
; // ignore (the config is outdated)
}
}
}
return junctionPointLayout;
}