本文整理汇总了Java中com.liferay.portal.model.LayoutConstants类的典型用法代码示例。如果您正苦于以下问题:Java LayoutConstants类的具体用法?Java LayoutConstants怎么用?Java LayoutConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutConstants类属于com.liferay.portal.model包,在下文中一共展示了LayoutConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: resolveListViewRedirectPage
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
/**
* Verifica se a comunidade atual possui alguma página com o portlet de
* todas as comunidades. Se encontrar alguma, faz o redirect para a página.
* Se não encontrar envia para a página de listagem padrão onde são exibidas
* somente as salas da comunidade atual.
*
* @throws SystemException
* @throws PortalException
* @throws IOException
*
*/
private void resolveListViewRedirectPage(ActionRequest req, ActionResponse rsp) throws PortalException, SystemException, IOException {
ThemeDisplay td = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);
long plid = PortalUtil.getPlidFromPortletId(td.getScopeGroupId(), CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID);
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletURL portletURL = PortletURLFactoryUtil.create(req, CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID, plid, PortletRequest.ACTION_PHASE);
portletURL.setParameter("javax.portlet.action", "listChatRooms");
portletURL.setParameter("p_p_lifecycle", "1");
String url = portletURL.toString();
rsp.sendRedirect(url);
} else {
rsp.setRenderParameter(ChatPortletConstants.VIEW_PARAM, ChatRoomView.LIST.getUrlParamValue());
}
}
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:28,代码来源:ChatRoomPortlet.java
示例2: montarlinkParaSala
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
private String montarlinkParaSala(Long roomId, String lifecycle, String parameterKey, String parameterValue, String parameter_p_p_LifeCycle) {
String url = StringPool.BLANK;
try {
ChatRoom chatRoom = ChatRoomLocalServiceUtil.getChatRoom(roomId);
long groupId = chatRoom.getGroupId();
long plid = PortalUtil.getPlidFromPortletId(groupId, CD_CHAT_ROOM_PORTLET_ID);
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletRequest request = (PortletRequest) LiferayFacesContext.getInstance().getExternalContext().getRequest();
PortletURL portletURL = PortletURLFactoryUtil.create(request, CD_CHAT_ROOM_PORTLET_ID, plid, lifecycle);
portletURL.setParameter(parameterKey, parameterValue);
portletURL.setParameter("roomId", roomId.toString());
portletURL.setParameter("p_p_lifecycle", parameter_p_p_LifeCycle);
url = portletURL.toString();
// LiferayFacesContext.getInstance().getExternalContext().redirect(url);
// // colocar quando sair nova versão do bridge jsf do liferay
// (stateless)
LinkSalasCacheUtil.setLinkEntrar(roomId, url);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return url;
}
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:25,代码来源:RedirecionaSalasPortalBean.java
示例3: getParentLayoutId
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
@Override
public long getParentLayoutId() {
long parentLayoutId = super.getParentLayoutId();
if (parentLayoutId == LayoutConstants.DEFAULT_PARENT_LAYOUT_ID) {
Layout junctionPointLayout = JunctionPointUtil.getConfiguredJunctionPointLayout(getWrappedModel());
if (junctionPointLayout != null && junctionPointLayout.getParentLayoutId() != LayoutConstants.DEFAULT_PARENT_LAYOUT_ID) {
// HACK! Das Breadcrumb-Portlet fragt erst die ParentLayoutId ab und ruft danach getParentLayout, falls die ID != 0 ist.
// andere Klassen machen dies aber leider ganz anders.
StackTraceElement stackTraceElement = new Exception().getStackTrace()[1];
if ("com.liferay.taglib.ui.BreadcrumbTag".equals(stackTraceElement.getClassName())) {
return -1;
}
}
}
return parentLayoutId;
}
开发者ID:frickeo,项目名称:liferay-junction-point-hook,代码行数:19,代码来源:JunctionPointLayoutWrapper.java
示例4: getPortalPageLayout
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
protected Layout getPortalPageLayout(long userId, long groupId, String portalPageName, boolean privateLayout)
throws Exception {
Layout portalPageLayout = null;
List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(groupId, privateLayout);
for (Layout layout : layouts) {
if (layout.getName(Locale.US).equals(portalPageName)) {
portalPageLayout = layout;
}
}
if (portalPageLayout == null) {
long parentLayoutId = LayoutConstants.DEFAULT_PARENT_LAYOUT_ID;
String type = LayoutConstants.TYPE_PORTLET;
boolean hidden = false;
String friendlyURL = "/" + portalPageName.toLowerCase();
portalPageLayout = ServiceUtil.addLayout(userId, groupId, privateLayout, parentLayoutId, portalPageName,
portalPageName, portalPageName, type, hidden, friendlyURL);
}
return portalPageLayout;
}
开发者ID:ngriffin7a,项目名称:portletbox,代码行数:25,代码来源:TestSetupAction.java
示例5: getLayoutView
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public LayoutView getLayoutView(
long groupId, boolean privateLayout, String rootNodeName,
Locale locale)
throws PortalException, SystemException {
_groupId = groupId;
_privateLayout = privateLayout;
_locale = locale;
_nodeId = 1;
_list = new ArrayList<String>();
_list.add(
"1|0|0|" + LayoutConstants.DEFAULT_PLID + "|" + rootNodeName +
"|0");
_createList(LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, _nodeId, 0);
return new LayoutView(_list, _depth);
}
开发者ID:wbstr,项目名称:liferay-newsletter,代码行数:21,代码来源:LayoutLister.java
示例6: LearningActivityBaseAssetRenderer
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public LearningActivityBaseAssetRenderer (LearningActivity learningactivity, LearningActivityType learningActivityType, boolean isLmsExternalTemplates) throws SystemException,PortalException {
_learningactivity = learningactivity;
_nameKey = learningActivityType.getName();
_portletId = learningActivityType.getPortletId();
_editDetails = learningActivityType.hasEditDetails();
_isLmsExternalTemplates = isLmsExternalTemplates;
ThreadLocalCache<Layout> threadLocalCache =
ThreadLocalCacheManager.getThreadLocalCache(
Lifecycle.REQUEST, LearningActivityBaseAssetRenderer.class.getName());
String layoutKey = _learningactivity.getCompanyId()+StringPool.SLASH+_learningactivity.getGroupId();
_layout = threadLocalCache.get(layoutKey);
if(Validator.isNull(_layout)) {
@SuppressWarnings("unchecked")
List<Layout> layouts = LayoutLocalServiceUtil.dynamicQuery(LayoutLocalServiceUtil.dynamicQuery().
add(PropertyFactoryUtil.forName("privateLayout").eq(false)).
add(PropertyFactoryUtil.forName("type").eq(LayoutConstants.TYPE_PORTLET)).
add(PropertyFactoryUtil.forName("companyId").eq(_learningactivity.getCompanyId())).
add(PropertyFactoryUtil.forName("groupId").eq(_learningactivity.getGroupId())).
add(PropertyFactoryUtil.forName("friendlyURL").eq("/reto")), 0, 1);
if(layouts.isEmpty()) {
throw new NoSuchLayoutException();
}
_layout = layouts.get(0);
threadLocalCache.put(layoutKey, _layout);
}
if(!((LayoutTypePortlet)_layout.getLayoutType()).getPortletIds().contains(_portletId)){
_isRuntimePortlet = true;
}
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:37,代码来源:LearningActivityBaseAssetRenderer.java
示例7: getURLCalifications
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public static final PortletURL getURLCalifications(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, LearningActivity activity) throws Exception {
long plid = PortalUtil.getPlidFromPortletId(activity.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingModule", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.TRUE);
portletURL.setParameter("actId",Long.toString( activity.getActId()));
long userId = PrincipalThreadLocal.getUserId();
if(Validator.isNotNull(userId)) {
//portletURL.setParameter("mvcPath", "/html/editactivity/editactivity.jsp");
portletURL.setParameter("califications", StringPool.TRUE);
portletURL.setParameter("editing", StringPool.FALSE);
portletURL.setParameter("resId",Long.toString( activity.getActId()));
portletURL.setParameter("resModuleId",Long.toString( activity.getModuleId()));
}
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLCalifications: "+portletURL);
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:37,代码来源:LmsActivitiesList.java
示例8: getURLEditActivity
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public static final PortletURL getURLEditActivity(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, LearningActivity activity) throws Exception {
PortletURL portletURL = null;
if(activity!=null){
long plid = PortalUtil.getPlidFromPortletId(activity.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actId",Long.toString( activity.getActId()));
portletURL.setParameter("moduleId",Long.toString( activity.getModuleId()));
portletURL.setParameter("actionEditingActivity", StringPool.TRUE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("actionEditingModule", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
long userId = PrincipalThreadLocal.getUserId();
if(Validator.isNotNull(userId)) {
portletURL.setParameter("mvcPath", "/html/editactivity/editactivity.jsp");
portletURL.setParameter("editing", StringPool.TRUE);
portletURL.setParameter("resId",Long.toString( activity.getActId()));
portletURL.setParameter("resModuleId",Long.toString( activity.getModuleId()));
}
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLEditActivity: "+portletURL);
}
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:41,代码来源:LmsActivitiesList.java
示例9: getURLCreateActivity
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public static final PortletURL getURLCreateActivity(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, Module module) throws Exception {
PortletURL portletURL = null;
if(module!=null){
long plid = PortalUtil.getPlidFromPortletId(module.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingActivity", StringPool.TRUE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("mvcPath", "/html/lmsactivitieslist/newactivity.jsp");
portletURL.setParameter("resModuleId",Long.toString(module.getModuleId()));
portletURL.setParameter("actId",Long.toString(0));
portletURL.setParameter("resId",Long.toString(0));
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
log.debug(" getURLCreateActivity: "+portletURL);
}
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:29,代码来源:LmsActivitiesList.java
示例10: getURLEditModule
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public static final PortletURL getURLEditModule(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, Module module) throws Exception {
PortletURL portletURL = null;
if(module!=null){
long plid = PortalUtil.getPlidFromPortletId(module.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITMODULE_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingModule", StringPool.TRUE);
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("view", "editmodule");
portletURL.setParameter("moduleId",Long.toString(module.getModuleId()));
portletURL.setParameter("actId","");
portletURL.setParameter("resourcePrimKey",Long.toString(module.getModuleId()));
portletURL.setParameter("editType","edit");
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLEditModule: "+portletURL);
}
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:33,代码来源:LmsActivitiesList.java
示例11: getURLCreateModule
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public static final PortletURL getURLCreateModule(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, ThemeDisplay themeDisplay) throws Exception {
Layout layout = null;
@SuppressWarnings("unchecked")
List<Layout> layouts = LayoutLocalServiceUtil.dynamicQuery(LayoutLocalServiceUtil.dynamicQuery().
add(PropertyFactoryUtil.forName("privateLayout").eq(false)).
add(PropertyFactoryUtil.forName("type").eq(LayoutConstants.TYPE_PORTLET)).
add(PropertyFactoryUtil.forName("companyId").eq(themeDisplay.getCompanyId())).
add(PropertyFactoryUtil.forName("groupId").eq(themeDisplay.getScopeGroupId())).
add(PropertyFactoryUtil.forName("friendlyURL").eq("/reto")), 0, 1);
if(layouts.isEmpty()) {
throw new NoSuchLayoutException();
}
layout = layouts.get(0);
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(layout.getPlid(), LMS_EDITMODULE_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingModule", StringPool.TRUE);
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("view", "editmodule");
portletURL.setParameter("moduleId",Long.toString(0));
portletURL.setParameter("actId","");
portletURL.setParameter("resourcePrimKey",Long.toString(0));
portletURL.setParameter("editType","add");
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLCreateModule: "+portletURL);
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:38,代码来源:LmsActivitiesList.java
示例12: getUltimaPaginaVisitada
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
/**
* Obtem a última URL acessada pelo usuário, antes da página de cadastro
*
* @param req
* @return
* @throws SystemException
* @throws PortalException
*/
public static long getUltimaPaginaVisitada() throws PortalException, SystemException {
LiferayFacesContext facesContext = LiferayFacesContext.getInstance();
long companyId = facesContext.getCompanyId();
PortletRequest req = facesContext.getPortletRequest();
LastPath lp = (LastPath) req.getPortletSession().getAttribute(WebKeys.LAST_PATH, PortletSession.APPLICATION_SCOPE);
// Plid da página para onde redirecionar de volta: ou para a
// página de onde veio
// ou para a página incial
long plid = LayoutConstants.DEFAULT_PLID;
if (lp != null) {
plid = getPlidFromFriendlyURL(companyId, lp.getContextPath() + lp.getPath());
_log.info("PLID : " + plid + " lp " + lp.getContextPath() + lp.getPath());
} else {
_log.info("LP NULL");
}
// Página inicial
if (plid == LayoutConstants.DEFAULT_PLID) {
Group grupoGuest = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
try {
Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(grupoGuest.getGroupId(), false, "/principal");
plid = layout.getPlid();
} catch (NoSuchLayoutException e) {
plid = LayoutLocalServiceUtil.getDefaultPlid(grupoGuest.getGroupId(), false);
}
}
return plid;
}
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:39,代码来源:LiferayCadastroUtil.java
示例13: montarlinkParaBotaoVoltar
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
private String montarlinkParaBotaoVoltar() {
String url = StringPool.BLANK;
try {
ThemeDisplay themeDisplay = (ThemeDisplay) LiferayFacesContext.getInstance().getPortletRequest().getAttribute(WebKeys.THEME_DISPLAY);
long plid = themeDisplay.getPlid();
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletRequest request = (PortletRequest) LiferayFacesContext.getInstance().getExternalContext().getRequest();
PortletURL portletURL = PortletURLFactoryUtil.create(request, CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID, plid, PortletRequest.RENDER_PHASE);
url = portletURL.toString();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return url;
}
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:16,代码来源:RedirecionaSalasPortalBean.java
示例14: getURLViewInContext
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_song.getGroupId(), PortletKeys.SONGS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.SONGS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/songs/view_song.jsp");
portletURL.setParameter(
"songId", String.valueOf(_song.getSongId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:SongAssetRenderer.java
示例15: getURLViewInContext
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_album.getGroupId(), PortletKeys.ALBUMS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.ALBUMS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/albums/view_album.jsp");
portletURL.setParameter(
"albumId", String.valueOf(_album.getAlbumId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:AlbumAssetRenderer.java
示例16: getURLViewInContext
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_artist.getGroupId(), PortletKeys.ARTISTS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.ARTISTS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/artists/view_artist.jsp");
portletURL.setParameter(
"artistId", String.valueOf(_artist.getArtistId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:ArtistAssetRenderer.java
示例17: getConfiguredJunctionPointLayout
import com.liferay.portal.model.LayoutConstants; //导入依赖的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;
}
开发者ID:frickeo,项目名称:liferay-junction-point-hook,代码行数:40,代码来源:JunctionPointImpl.java
示例18: afterPropertiesSet
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
public void afterPropertiesSet() throws Exception {
User user = UserLocalServiceUtil.getDefaultUser(companyId);
userId = user.getUserId();
Group group = null;
if (targetClassName.equals(LayoutSetPrototype.class.getName())) {
LayoutSetPrototype layoutSetPrototype = getLayoutSetPrototype(
companyId, targetValue);
if (layoutSetPrototype != null) {
existing = true;
}
else {
layoutSetPrototype =
LayoutSetPrototypeLocalServiceUtil.addLayoutSetPrototype(
userId, companyId, getTargetValueMap(),
StringPool.BLANK, true, true, new ServiceContext());
}
group = layoutSetPrototype.getGroup();
targetClassPK = layoutSetPrototype.getLayoutSetPrototypeId();
}
else if (targetClassName.equals(Group.class.getName())) {
if (targetValue.equals(GroupConstants.GUEST)) {
group = GroupLocalServiceUtil.getGroup(
companyId, GroupConstants.GUEST);
List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(
group.getGroupId(), false,
LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, false, 0, 1);
if (!layouts.isEmpty()) {
Layout layout = layouts.get(0);
LayoutTypePortlet layoutTypePortlet =
(LayoutTypePortlet)layout.getLayoutType();
List<String> portletIds = layoutTypePortlet.getPortletIds();
if (portletIds.size() != 2) {
existing = true;
}
for (String portletId : portletIds) {
if (!portletId.equals("47") &&
!portletId.equals("58")) {
existing = true;
}
}
}
}
else {
group = GroupLocalServiceUtil.fetchGroup(
companyId, targetValue);
if (group != null) {
existing = true;
}
else {
group = GroupLocalServiceUtil.addGroup(
userId, GroupConstants.DEFAULT_PARENT_GROUP_ID,
StringPool.BLANK,
GroupConstants.DEFAULT_PARENT_GROUP_ID,
GroupConstants.DEFAULT_LIVE_GROUP_ID, targetValue,
StringPool.BLANK, GroupConstants.TYPE_SITE_OPEN, true,
GroupConstants.DEFAULT_MEMBERSHIP_RESTRICTION, null,
true, true, new ServiceContext());
}
}
targetClassPK = group.getGroupId();
}
if (group != null) {
groupId = group.getGroupId();
}
}
开发者ID:rivetlogic,项目名称:liferay-document-and-media-treeview,代码行数:82,代码来源:BaseImporter.java
示例19: createLayout
import com.liferay.portal.model.LayoutConstants; //导入依赖的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
示例20: setupSitemap
import com.liferay.portal.model.LayoutConstants; //导入依赖的package包/类
protected void setupSitemap(String fileName) throws Exception {
LayoutLocalServiceUtil.deleteLayouts(
groupId, true, new ServiceContext());
LayoutLocalServiceUtil.deleteLayouts(
groupId, false, new ServiceContext());
JSONObject jsonObject = getJSONObject(fileName);
if (jsonObject == null) {
return;
}
_defaultLayoutTemplateId = jsonObject.getString(
"layoutTemplateId", StringPool.BLANK);
updateLayoutSetThemeId(jsonObject);
JSONArray layoutsJSONArray = jsonObject.getJSONArray("layouts");
if (layoutsJSONArray != null) {
addLayouts(
false, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
layoutsJSONArray);
}
else {
JSONArray publicPagesJSONArray = jsonObject.getJSONArray(
"publicPages");
if (publicPagesJSONArray != null) {
addLayouts(
false, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
publicPagesJSONArray);
}
JSONArray privatePagesJSONArray = jsonObject.getJSONArray(
"privatePages");
if (privatePagesJSONArray != null) {
addLayouts(
true, LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
privatePagesJSONArray);
}
}
}
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:46,代码来源:FileSystemImporter.java
注:本文中的com.liferay.portal.model.LayoutConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论