• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BlogsEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: listar

import com.liferay.portlet.blogs.model.BlogsEntry; //导入依赖的package包/类
@Override
protected List<RecursoDTO> listar(Connection connection, Configuracao config, long companyId) throws SQLException {
	boolean possuiComunidade = config.getComunidadeSelecionada() > 0;

	long blogEntryClassId = ClassNameLocalServiceUtil.getClassNameId(BlogsEntry.class);

	PreparedStatement pstmt = null;
	ResultSet rs = null;
	List<RecursoDTO> retorno = new ArrayList<RecursoDTO>();
	String sql = SQLBuilder.buildSQLBlogsComMaiorParticipacao(config);

	try {
		pstmt = connection.prepareStatement(sql);
		pstmt.setLong(1, companyId);
		pstmt.setLong(2, blogEntryClassId);

		pstmt.setTimestamp(3, new Timestamp(config.getDataInicioPeriodoEmMillis()));
		pstmt.setTimestamp(4, new Timestamp(config.getDataFimPeriodoEmMillis()));

		if (possuiComunidade) {
			pstmt.setLong(5, config.getComunidadeSelecionada());
		}
		
		pstmt.setMaxRows(getQuantidadeMaximaDeResultados(config));
		
		rs = pstmt.executeQuery();

		BeanListHandler<RecursoDTO> handler = new BeanListHandler<RecursoDTO>(RecursoDTO.class);
		retorno = handler.handle(rs);

	} finally {
		DataAccess.cleanUp(rs);
		DataAccess.cleanUp(pstmt);
	}

	return retorno;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:38,代码来源:BlogsComMaiorParticipacao.java


示例2: getBlogLinks

import com.liferay.portlet.blogs.model.BlogsEntry; //导入依赖的package包/类
public static List<ContentLinks> getBlogLinks(
		long groupId, 
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse,
		ThemeDisplay themeDisplay, 
		boolean getLinks,
		boolean getImages)
	throws Exception {

	_log.debug("getBlogLinks for groupId " + String.valueOf(groupId));

	List<ContentLinks> contentLinksList = new ArrayList<ContentLinks>();

	List<BlogsEntry> blogsEntryList = BlogsEntryLocalServiceUtil.getGroupEntries(groupId, WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS);

	PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
			PortalUtil.getControlPanelPlid(liferayPortletRequest), 
			PortletKeys.BLOGS_ADMIN,
			PortletRequest.RENDER_PHASE);

	portletURL.setWindowState(LiferayWindowState.POP_UP);
	portletURL.setParameter("struts_action", "/blogs_admin/edit_entry");

	for (BlogsEntry blogsEntry : blogsEntryList) {
		
		if (!hasPermissionView(groupId, blogsEntry.getModelClassName(), blogsEntry.getPrimaryKey(), themeDisplay)) {
			continue;
		}

		String content = blogsEntry.getContent();

		if (content != null) {

			List<String> links = parseLinks(content, getLinks, getImages);

			if (links.size() > 0) {

				portletURL.setParameter("entryId", String.valueOf(blogsEntry.getEntryId()));

				ContentLinks contentLinks = new ContentLinks();
				contentLinks.setClassName(blogsEntry.getModelClassName());
				contentLinks.setClassPK(blogsEntry.getEntryId());
				contentLinks.setContentTitle(blogsEntry.getTitle());
				contentLinks.setContentEditLink(portletURL.toString());
				contentLinks.setModifiedDate(blogsEntry.getModifiedDate());
				contentLinks.setStatus(blogsEntry.getStatus());
				
				_log.debug("Extracting links from blog entry " + blogsEntry.getEntryId() + " - " + blogsEntry.getTitle());
				
				for (String link : links) {

					contentLinks.addLink(link);
				}
				
				contentLinksList.add(contentLinks);
			}
		}
	}

	return contentLinksList;
}
 
开发者ID:craigvershaw,项目名称:link-scanner,代码行数:62,代码来源:LinkScannerUtil.java


示例3: serveResource

import com.liferay.portlet.blogs.model.BlogsEntry; //导入依赖的package包/类
@Override
public void serveResource(StrutsPortletAction originalStrutsPortletAction,
		PortletConfig portletConfig, ResourceRequest resourceRequest,
		ResourceResponse resourceResponse) throws Exception {

	long entryId = ParamUtil.getLong(resourceRequest, "entryId");

	BlogsEntry entry = BlogsEntryLocalServiceUtil.getBlogsEntry(entryId);

	String content = entry.getContent();
	String blogTitle = "Blogs-" + entry.getEntryId();

	File tempXlsFile = null;

	try {

		tempXlsFile = AsposeExportServiceUtil
				.createTempFile(AsposeExportServiceUtil.XLS_FILE_EXT);
		AsposeExportServiceUtil
				.exportToXls(tempXlsFile, content.getBytes());
		String downloadXlsFileName = blogTitle
				+ AsposeExportServiceUtil.XLS_FILE_EXT;
		AsposeExportServiceUtil.sendFile(resourceRequest, resourceResponse,
				tempXlsFile, downloadXlsFileName);

	} catch (Exception e) {

		String msg = "Error exporting blog entry " + entryId
				+ " (to xls) :" + e.getMessage();

		s_log.error(msg, e);

		throw new PortalException(msg, e);

	} finally {

		AsposeExportServiceUtil.safeDeleteFile(tempXlsFile);
		tempXlsFile = null;

	}
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Liferay,代码行数:42,代码来源:AsposeBlogExportXlsAction.java


示例4: serveResource

import com.liferay.portlet.blogs.model.BlogsEntry; //导入依赖的package包/类
@Override
public void serveResource(StrutsPortletAction originalStrutsPortletAction,
		PortletConfig portletConfig, ResourceRequest resourceRequest,
		ResourceResponse resourceResponse) throws Exception {

	long entryId = ParamUtil.getLong(resourceRequest, "entryId");

	BlogsEntry entry = BlogsEntryLocalServiceUtil.getBlogsEntry(entryId);

	String content = entry.getContent();
	String blogTitle = "Blogs-" + entry.getEntryId();

	File tempPdfFile = null;

	try {

		tempPdfFile = AsposeExportServiceUtil
				.createTempFile(AsposeExportServiceUtil.PDF_FILE_EXT);
		AsposeExportServiceUtil
				.exportToPdf(tempPdfFile, content.getBytes());
		String downloadPdfFileName = blogTitle
				+ AsposeExportServiceUtil.PDF_FILE_EXT;
		AsposeExportServiceUtil.sendFile(resourceRequest, resourceResponse,
				tempPdfFile, downloadPdfFileName);

	} catch (Exception e) {

		String msg = "Error exporting blog entry " + entryId
				+ " (to Pdf) :" + e.getMessage();

		s_log.error(msg, e);

		throw new PortalException(msg, e);

	} finally {

		AsposeExportServiceUtil.safeDeleteFile(tempPdfFile);
		tempPdfFile = null;

	}
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Liferay,代码行数:42,代码来源:AsposeBlogExportPdfAction.java


示例5: serveResource

import com.liferay.portlet.blogs.model.BlogsEntry; //导入依赖的package包/类
@Override
public void serveResource(StrutsPortletAction originalStrutsPortletAction,
		PortletConfig portletConfig, ResourceRequest resourceRequest,
		ResourceResponse resourceResponse) throws Exception {

	long entryId = ParamUtil.getLong(resourceRequest, "entryId");

	BlogsEntry entry = BlogsEntryLocalServiceUtil.getBlogsEntry(entryId);

	String content = entry.getContent();
	String blogTitle = "Blogs-" + entry.getEntryId();

	File tempDocFile = null;

	try {

		tempDocFile = AsposeExportServiceUtil
				.createTempFile(AsposeExportServiceUtil.DOC_FILE_EXT);
		AsposeExportServiceUtil
				.exportToDoc(tempDocFile, content.getBytes());
		String downloadDocFileName = blogTitle
				+ AsposeExportServiceUtil.DOC_FILE_EXT;
		AsposeExportServiceUtil.sendFile(resourceRequest, resourceResponse,
				tempDocFile, downloadDocFileName);

	} catch (Exception e) {

		String msg = "Error exporting blog entry " + entryId
				+ " (to doc) :" + e.getMessage();

		s_log.error(msg, e);

		throw new PortalException(msg, e);

	} finally {

		AsposeExportServiceUtil.safeDeleteFile(tempDocFile);
		tempDocFile = null;

	}
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Liferay,代码行数:42,代码来源:AsposeBlogExportDocAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThreadLocalRequestContext类代码示例发布时间:2022-05-23
下一篇:
Java CQLStatement类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap