本文整理汇总了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;未经允许,请勿转载。 |
请发表评论