/* ================================================================== * Created [2009-4-27 下午11:32:55] by Jon.King * ================================================================== * TSS * ================================================================== * mailTo:jinpujun@hotmail.com * Copyright (c) Jon.King, 2009-2012 * ================================================================== */ package com.jinhe.tss.cms.dao; import java.util.Date; import java.util.List; import java.util.Map; import com.jinhe.tss.cms.entity.Article; import com.jinhe.tss.cms.entity.Attachment; import com.jinhe.tss.cms.entity.ChannelArticle; import com.jinhe.tss.cms.helper.ArticleQueryCondition; import com.jinhe.tss.component.support.persistence.pagequery.PageInfo; import com.jinhe.tss.core.persistence.IDao; /** * Article的Dao层接口,定义所有Article相关的数据库操作接口 */ public interface IArticleDao extends IDao<Article> { /** * <p> * 根据栏目id获取发布成xml文件(真实发布状态)的文章列表 * </p> * @param channelId * @return */ List<?> getPublishedArticleByChannel(Long channelId); /** * <p> * 获取栏目文章关联表中选中栏目ID的最大序号 * </p> * @param channelId * @return */ Integer getChannelArticleNextOrder(Long channelId); /** * <p> * 根据文章ID获取文章附件列表 * </p> * @param articleId * @return */ Map<String, Attachment> getArticleAttachments(Long articleId); /** * <p> * 根据栏目ID和文章ID获取栏目文章关系信息 * </p> * @param condition * @return */ ChannelArticle getChannelArticle(Long articleId, Long channelId); /** * <p> * 根据文章ID获取此文章附件最大的序号 * </p> * @param id * @return */ Integer getAttachmentNextOrder(Long id); /** * <p> * 通过文章id获取栏目ID * </p> * @param articleId * @return */ Long getChannelIdByArticleId(Long articleId); /** * <p> * 通过文章id获得其相关文章的List列表 * </p> * @param articleId * @return */ List<?> getArticleLationsById(Long articleId); /** * <p> * 通过文章id获得相关文章关系列表 * </p> * @param articleId * @return */ List<?> getLationsById(Long articleId); /** * <p> * 获得文章的相关文章的最大序号 * </p> * @param articleId * @return */ Integer getArticleLationNextOrder(Long articleId); /** * <p> * 通过文章ID获得所有分发到该文章的栏目列表 * </p> * @param articleId * @return */ List<?> getDispathedToChannels(Long articleId); /** * <p> * 通过文章id获得所有的栏目文章关系表中分发文章关系的列表 * </p> * @param articleId * @return */ List<?> getFFChannelArticleListByArticle(Long articleId); /** * <p> * 通过栏目id和文章id获得所有的栏目文章关系表中转载文章关系的列表 * </p> * @param ArticleId * @param channelId * @return */ List<?> getZZChannelArticleList(Long articleId,Long channelId); /** * <p> * 获得栏目的文章列表 * </p> * @param channelId * @param pageNum * @param orderBy * @return */ PageInfo getPageList(Long channelId, Integer pageNum, String...orderBy); /** * <p> * 条件搜索栏目及其子栏目的文章列表 * </p> * @param condition * @return */ PageInfo getSearchArticlePageList(ArticleQueryCondition condition); /** * <p> * 获取栏目的分页文章列表,Portlet远程调用时使用 * </p> * @param condition * @return */ PageInfo getChannelPageArticleList(ArticleQueryCondition condition); /** * 根据栏目ids,获取这些栏目下的所有文章列表 * @param condition * @param isArchives * @return */ PageInfo getArticlesByChannelIds(ArticleQueryCondition condition); /** * 获取已发布成xml文件的相关文章列表 * @param articleId * @return * @see getArticleLationsById(Long articleId) */ List<?> getRelationArticles(Long articleId); /** * <p> * 根据权限项ID(operationId)查找用户对该流程步骤是否有权限 * </p> * @param operationId 权限项目ID * @param resourceId 流程步骤ID * @return */ boolean checkArticleWorkflowPermission(String operationId, Long resourceId); /** * 本方法与Article getEntity()一致,都是读取文章,不同的是fetch不会被动态属性拦截器拦截, * 适合修改单个文章属性的保存操作,像发布文章时修改文章的发布的路径,如此可提高性能。 * @param id * @return */ Article fetchArticleById(Long id); /** * <p>动态属性save方法</p> * @param article * @return */ Article saveArticle(Article article); /** * 本方法与上面saveArticle一致,都是保存文章,不同的是renew不会被动态属性拦截器拦截, * 适合修改单个文章属性的保存操作,像发布文章时修改文章的发布的路径,如此可提高性能。 * @param article * @return */ Article renewArticle(Article article); /** * <p> * 物理删除文章信息 * </p> * @param article */ void deleteArticle(Article article); /** * <p> * 获取过期文章列表。 * 比较过期时间是早于当前时间,以及文章是否为”已发布“状态。其他状态没必要设置为过期。 * </p> * @param now * @param channelId * @return */ List<Article> getExpireArticlePuburlList(Date now, Long channelId); }