当前位置: 首页>>代码示例>>Java>>正文


Java LayoutLocalServiceUtil类代码示例

本文整理汇总了Java中com.liferay.portal.service.LayoutLocalServiceUtil的典型用法代码示例。如果您正苦于以下问题:Java LayoutLocalServiceUtil类的具体用法?Java LayoutLocalServiceUtil怎么用?Java LayoutLocalServiceUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LayoutLocalServiceUtil类属于com.liferay.portal.service包,在下文中一共展示了LayoutLocalServiceUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dossierDangkyAction

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public void dossierDangkyAction(ActionRequest request,
		ActionResponse response) throws PortletException, IOException {
	ThemeDisplay themeDisplay = (ThemeDisplay) request
			.getAttribute(WebKeys.THEME_DISPLAY);
	String pageName = "/dichvucongtructuyen";
	String portletName = "oepeserviceregisteronline_WAR_oepeserviceportlet";
	String dossierProcId = ParamUtil
			.getString(request, "dossierProcId", "");
	long plid = 0L;
	try {
		plid = LayoutLocalServiceUtil.getFriendlyURLLayout(
				themeDisplay.getScopeGroupId(), false, pageName).getPlid();
	} catch (Exception e) {
		e.printStackTrace();
	}

	PortletURL redirectURL = PortletURLFactoryUtil.create(
			PortalUtil.getHttpServletRequest(request), portletName, plid,
			PortletRequest.RENDER_PHASE);
	redirectURL.setParameter("dossierProcId", dossierProcId); 
	redirectURL.setParameter("data", "This Value Comes From Welcome Page");
	response.sendRedirect(redirectURL.toString());

}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:DossierProcPortlet.java

示例2: 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);
	}
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:25,代码来源:StartupAction.java

示例3: addPortletToPage

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public static String addPortletToPage(Layout layout, String portletId, E_ContextPath path, long userId) {
	String result = null;
	try {
		LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout.getLayoutType();
		
		// count all portlets currently registered for this column
		List<Portlet> portlets = layoutTypePortlet.getAllPortlets(path.getColumnId());
		int colSize = portlets != null ? portlets.size() : 0;
		// add new portlet at the very end
		result = layoutTypePortlet.addPortletId(userId, portletId, path.getColumnId(), colSize, false);
		
		// update the layout
		LayoutLocalServiceUtil.updateLayout(layout.getGroupId(),
                   layout.isPrivateLayout(),
                   layout.getLayoutId(),
                   layout.getTypeSettings());
		
	} catch (Throwable t) {
		m_objLog.warn(t);
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:23,代码来源:ParticityInitializer.java

示例4: makeElementoComunidade

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
private ElementoComunidade makeElementoComunidade(Group grp,
		ThemeDisplay td)
		throws SystemException, PortalException {
	long plid;
	long grpId = grp.getGroupId();
	if (grp.getPrivateLayoutsPageCount() > 0)
		plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, true);
	else
		plid = LayoutLocalServiceUtil.getDefaultPlid(grpId, false);
	Layout layout = LayoutLocalServiceUtil.getLayout(plid);
	
	String grpUrl = PortalUtil.getLayoutURL(layout, td, true);
	String grpName = grp.getName();
	String grpImgUrl = CommunityIconFinder.findUrl(td, grpId);
	return new ElementoComunidade(grpUrl, grpName, grpImgUrl);

}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:18,代码来源:ListaComunidadesPortlet.java

示例5: getMicroSiteURL

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public static String getMicroSiteURL(PortletRequest request, long groupId) 
        throws PortalException, SystemException {
    String scheme = request.getScheme();
    String serverName = request.getServerName();
    int serverPort = request.getServerPort();
    Group liveGroup = GroupLocalServiceUtil.getGroup(groupId);
    int layoutCount = LayoutLocalServiceUtil.getLayoutsCount(liveGroup, false);
    if(layoutCount > 0) {
        return scheme + HTTP_PREFIX  + serverName + StringPool.COLON + serverPort + StringPool.FORWARD_SLASH 
        		+ PUBLIC_PAGE_PREFIX + liveGroup.getFriendlyURL();
    }
    layoutCount = LayoutLocalServiceUtil.getLayoutsCount(liveGroup, true);
    if(layoutCount > 0) {
        return scheme + HTTP_PREFIX + serverName + StringPool.COLON + serverPort + StringPool.FORWARD_SLASH 
        		+ PRIVATE_PAGE_PREFIX + liveGroup.getFriendlyURL();
    }
    return StringPool.POUND;
}
 
开发者ID:rivetlogic,项目名称:liferay-microsite-manager,代码行数:19,代码来源:MicroSiteUtil.java

示例6: 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;
}
 
开发者ID:frickeo,项目名称:liferay-junction-point-hook,代码行数:22,代码来源:JunctionPointImpl.java

示例7: setupPage

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
protected void setupPage(long userId, long groupId, PortalPage portalPage, boolean privateLayout) throws Exception {
	String portalPageName = portalPage.getName();
	String[] portletIds = portalPage.getPortletIds();
	Layout portalPageLayout = getPortalPageLayout(userId, groupId, portalPageName, privateLayout);
	LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) portalPageLayout.getLayoutType();

	layoutTypePortlet.setLayoutTemplateId(userId, "2_columns_i", false);

	int columnNumber = 1;

	for (String portletId : portletIds) {

		if (portletId.endsWith("_INSTANCE_")) {
			portletId = portletId + "ABCD";
		}

		addPortlet(layoutTypePortlet, userId, columnNumber, portletId);
		columnNumber++;
	}

	LayoutLocalServiceUtil.updateLayout(portalPageLayout);

	logger.info("Setting up page name=[" + portalPageName + "]");
}
 
开发者ID:ngriffin7a,项目名称:portletbox,代码行数:25,代码来源:TestSetupAction.java

示例8: getPortalPageLayout

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的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

示例9: listChucDanh1

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public void listChucDanh1(ActionRequest request,
		ActionResponse response) throws PortletException, IOException {
	ThemeDisplay themeDisplay = (ThemeDisplay) request
			.getAttribute(WebKeys.THEME_DISPLAY);
	System.out.println(" ----------- " +  themeDisplay.getPortletDisplay().getPortletName());
	String portletName = "jobposmanagement_WAR_oepusermgtportlet";
	String pageName = "/dichvucongtructuyen";
	//String portletName = "oepeserviceregisteronline_WAR_oepeserviceportlet";
	String dossierProcId = ParamUtil
			.getString(request, "dossierProcId", "");
	long plid = 0L;
	try {
		plid = LayoutLocalServiceUtil.getFriendlyURLLayout(
				themeDisplay.getScopeGroupId(), false, pageName).getPlid();
	} catch (Exception e) {
		e.printStackTrace();
	}
	long workingUnitId = ParamUtil
			.getLong(request, WorkingUnitKeys.BaseWorkingUnitAttributes.EDIT_ID, PortletKeys.LONG_DEFAULT);


	PortletURL redirectURL = PortletURLFactoryUtil.create(
			PortalUtil.getHttpServletRequest(request), portletName, themeDisplay.getPlid(),
			PortletRequest.RENDER_PHASE);
	redirectURL.setParameter(WorkingUnitKeys.BaseWorkingUnitAttributes.EDIT_ID, String.valueOf(workingUnitId)); 
	response.sendRedirect(redirectURL.toString());

}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:29,代码来源:WorkingUnitPortlet.java

示例10: listCanBo

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public void listCanBo(ActionRequest request,
		ActionResponse response) throws PortletException, IOException {
	ThemeDisplay themeDisplay = (ThemeDisplay) request
			.getAttribute(WebKeys.THEME_DISPLAY);
	//ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
	String pageName = "/danh-sach-can-bo";
	String portletName = "employeemanagement_WAR_oepusermgtportlet";

	long plid = 0L;
	try {
		plid = LayoutLocalServiceUtil.getFriendlyURLLayout(
				themeDisplay.getScopeGroupId(), false, pageName).getPlid();
	} catch (Exception e) {
		e.printStackTrace();
	}
	System.out.println(" ----------- " + pageName + "     " + themeDisplay.getPlid());
	
	long workingUnitId = ParamUtil
			.getLong(request, WorkingUnitKeys.BaseWorkingUnitAttributes.EDIT_ID, PortletKeys.LONG_DEFAULT);


	PortletURL redirectURL = PortletURLFactoryUtil.create(
			PortalUtil.getHttpServletRequest(request), portletName, plid,
			PortletRequest.RENDER_PHASE);
	redirectURL.setParameter(WorkingUnitKeys.BaseWorkingUnitAttributes.EDIT_ID, String.valueOf(workingUnitId)); 
	response.sendRedirect(redirectURL.toString());

}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:29,代码来源:WorkingUnitPortlet.java

示例11: getLayouts

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
public List<Layout> getLayouts(){
	try {
		return LayoutLocalServiceUtil.getLayouts(getGroupId(), false);
	} catch (SystemException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return null;
	} 
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:10,代码来源:CourseView.java

示例12: LearningActivityBaseAssetRenderer

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的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

示例13: getURLCreateModule

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的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

示例14: getPlid

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
private long getPlid(long courseId,ThemeDisplay themeDisplay) throws SystemException{

		if((Validator.isNull(courseId))&&
				(themeDisplay.getLayout().getFriendlyURL().equals("/reto"))) {
			return themeDisplay.getLayout().getPlid();
		}
			
		Course course = null;

		if(Validator.isNotNull(courseId)) {
			course = CourseLocalServiceUtil.fetchCourse(courseId);
		}

		if(Validator.isNull(course)) {
			course = CourseLocalServiceUtil.fetchByGroupCreatedId(themeDisplay.getScopeGroupId());
		}

		if(Validator.isNull(course)) {
			return GetterUtil.DEFAULT_LONG;
		}

		@SuppressWarnings("unchecked")
		List<Layout> layouts = LayoutLocalServiceUtil.dynamicQuery(LayoutLocalServiceUtil.dynamicQuery().
				add(PropertyFactoryUtil.forName("privateLayout").eq(false)).
				add(PropertyFactoryUtil.forName("companyId").eq(course.getCompanyId())).
				add(PropertyFactoryUtil.forName("groupId").eq(course.getGroupCreatedId())).
				add(PropertyFactoryUtil.forName("friendlyURL").eq("/reto")),0,1);

		if(layouts.isEmpty()) {
			return GetterUtil.DEFAULT_LONG;
		}
		else {
			return layouts.get(0).getPlid();
		}	
	}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:36,代码来源:LearningActivityAssetRendererFactory.java

示例15: load

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入依赖的package包/类
@Override
public Layout load(final PortletPreferences preferences, final String key, final String defaultValue) {
	final String uuid = preferences.getValue(key, "");
	if (StringUtils.isEmpty(uuid)) {
		return null;
	}
	final long companyId = ServiceContextThreadLocal.getServiceContext().getCompanyId();
	try {
		return LayoutLocalServiceUtil.getLayoutByUuidAndCompanyId(uuid, companyId);
	} catch (final SystemException | PortalException e) {
		log.error("Could not load layout {}", uuid, e);
		return null;
	}
}
 
开发者ID:liefke,项目名称:org.portletbeans,代码行数:15,代码来源:LayoutFieldHandler.java


注:本文中的com.liferay.portal.service.LayoutLocalServiceUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。