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


Java LayoutLocalServiceUtil.getLayout方法代码示例

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


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

示例1: 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

示例2: 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,代码行数:16,代码来源:TodasComunidades.java

示例3: sendEmail

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public void sendEmail(SendListElem rcpt, InternetAddress from, String subject, String body, boolean sendHtml) {
        try {
            logger.info("sendEmail {0} {1} {2} {3}", new Object[]{from, subject, rcpt, body});

            List<NewsletterConfig> configs = NewsletterConfigLocalServiceUtil.findByConfigKey("subscriptionActionLayout");
            NewsletterConfig subscriptionActionLayout;
            subscriptionActionLayout = configs.get(0);
            Layout layout = null;
            layout = LayoutLocalServiceUtil.getLayout(Long.parseLong(subscriptionActionLayout.getConfigValue()));
//            layout = LayoutLocalServiceUtil.getLayoutByUuidAndGroupId(subscriptionActionLayout.getConfigValue(), themeDisplay.getScopeGroupId());
//            layout = LayoutLocalServiceUtil.getLayoutByUuidAndGroupId(subscriptionActionLayout.getConfigValue(), themeDisplay.getScopeGroupId(),false);
            String layoutURL = PortalUtil.getLayoutURL(layout, themeDisplay);

            MailMessage mailMessage = new MailMessage();
            String cancLink = "";
            if (rcpt.getNewsletterSubscriptionCategory() != null) {
                cancLink = rcpt.getNewsletterSubscriptionCategory().getCancellationKey();
            }
            body = body.replace("###newsletterCategory###", rcpt.getCategoryName());
            body = body.replace("###portalUrl###", themeDisplay.getURLPortal());
            //body = body.replace("###portalUrl###", themeDisplay.getURLHome()); //web/quest is needed
            //body = body.replace("###cancelattionLink###", "subscription?"+EmailConst.Action.CANCEL_PARAM_KEY+"=" + cancLink);
            body = body.replace("###cancelattionLink###", layoutURL + "?" + EmailConst.Action.CANCEL_PARAM_KEY + "=" + cancLink);
            mailMessage.setBody(body);
            mailMessage.setHTMLFormat(sendHtml);
            mailMessage.setFrom(from);
            mailMessage.setTo(rcpt.getSubscriptionEmail());
            mailMessage.setSubject(subject);
            MailServiceUtil.sendEmail(mailMessage);
        } catch (Exception e) {
            logger.error(e);
        }
    }
 
开发者ID:wbstr,项目名称:liferay-newsletter,代码行数:34,代码来源:NewsletterSenderThread.java

示例4: changeLayout

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
public void changeLayout(ActionRequest request, ActionResponse response) throws Exception
{

		try {
			ThemeDisplay themeDisplay = (ThemeDisplay) request
					.getAttribute(WebKeys.THEME_DISPLAY);
			if (!themeDisplay.isSignedIn()) {
				return;
			}
			String layoutid = ParamUtil.getString(request, "layoutid");
			Layout ellayout = LayoutLocalServiceUtil.getLayout(Long
					.parseLong(layoutid));

			Role siteMemberRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), RoleConstants.SITE_MEMBER);
			Role userRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), RoleConstants.USER);
			boolean visible = ResourcePermissionLocalServiceUtil.hasResourcePermission(siteMemberRole.getCompanyId(), Layout.class.getName(), 
					ResourceConstants.SCOPE_INDIVIDUAL, layoutid, new long[] {siteMemberRole.getRoleId(), userRole.getRoleId()}, ActionKeys.VIEW);
			if(!visible){	
				
				ResourcePermissionLocalServiceUtil.setResourcePermissions(
						themeDisplay.getCompanyId(),
						Layout.class.getName(),
						ResourceConstants.SCOPE_INDIVIDUAL,
						layoutid,
						siteMemberRole.getRoleId(),
						new String[] { ActionKeys.VIEW });
			} else {
				//ellayout.setHidden(true);
				ResourcePermissionLocalServiceUtil.removeResourcePermission(
						themeDisplay.getCompanyId(),
						Layout.class.getName(),
						ResourceConstants.SCOPE_INDIVIDUAL,
						layoutid,
						siteMemberRole.getRoleId(), ActionKeys.VIEW);
				ResourcePermissionLocalServiceUtil.removeResourcePermission(
						themeDisplay.getCompanyId(),
						Layout.class.getName(),
						ResourceConstants.SCOPE_INDIVIDUAL,
						layoutid,
						userRole.getRoleId(), ActionKeys.VIEW);
			}
			//LayoutLocalServiceUtil.updateLayout(ellayout);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//response.setRenderParameters(request.getParameterMap());			
		response.setRenderParameter("jspPage", "/html/coursetoolsmanage/reload.jsp");		
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:49,代码来源:CourseToolsManage.java

示例5: getConfirmationLink

import com.liferay.portal.service.LayoutLocalServiceUtil; //导入方法依赖的package包/类
private String getConfirmationLink() throws PortalException {
        try {
            if (ListUtil.isEmpty(confirmationKeys)) {
                return null;            
            }
            
            StringBuilder body = new StringBuilder();
            body.append("<a href=\"");
            List<NewsletterConfig> configs = NewsletterConfigLocalServiceUtil.findByConfigKey("subscriptionActionLayout");
                NewsletterConfig subscriptionActionLayout;
                subscriptionActionLayout = configs.get(0);
                Layout layout = null;
                layout = LayoutLocalServiceUtil.getLayout(Long.parseLong(subscriptionActionLayout.getConfigValue()));
//                layout = LayoutLocalServiceUtil.getLayoutByUuidAndGroupId(subscriptionActionLayout.getConfigValue(), LiferayUtil.getThemeDisplay().getScopeGroupId());
//                layout = LayoutLocalServiceUtil.getLayoutByUuidAndGroupId(subscriptionActionLayout.getConfigValue(), LiferayUtil.getThemeDisplay().getScopeGroupId(),false);
                String layoutURL = PortalUtil.getLayoutURL(layout, LiferayUtil.getThemeDisplay());
              
            body.append(LiferayUtil.getThemeDisplay().getURLPortal());
//            body.append("/subscription?");
              body.append(layoutURL);
              body.append("?");
         
            for (int i = 0; i < confirmationKeys.size(); i++) {
                String confirmationKey = confirmationKeys.get(i);
       
                if (i > 0) {
                    body.append("&");            
                }
                body.append(EmailConst.Action.CONFIRM_PARAM_KEY).append("=").append(confirmationKey);        
            }
            
            body.append("\">");
            body.append("Megerősít/Confirm");
            body.append("</a>");

            body.append("<br />");    
            
            return new String(body);
        } catch (SystemException ex) {
            Logger.getLogger(ConfirmEmailLinkReplacer.class.getName()).log(Level.SEVERE, null, ex);
        }
        return "";
    }
 
开发者ID:wbstr,项目名称:liferay-newsletter,代码行数:44,代码来源:ConfirmEmailLinkReplacer.java


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