public class WriterServiceImpl extends Object implements WriterService
| Constructor and Description |
|---|
WriterServiceImpl()
Instantiates a new Writer service impl.
|
| Modifier and Type | Method and Description |
|---|---|
Comment |
addComment(Comment comment)
Adds a comment.
|
void |
deleteComment(long commentId)
Deletes a comment.
|
Article |
getArticle(long articleId)
Gets a specific article.
|
ArticleRejection |
getArticleRejection(long rejectionId)
Gets the rejection for the specified id.
|
List<Article> |
getArticles(String tool,
long topicId,
int from,
int fetchSize)
Gets articles that matches the specified criteria
|
List<Category> |
getCategories()
Gets all the categories
|
Category |
getCategory(long categoryId)
Gets the specific category
|
List<Comment> |
getCommentsForArticle(long articleId)
Returns a list of comments that was placed on the specified article.
|
Media |
getMedia(long mediaId)
Gets the spesified media
|
File |
getMediaFile(long mediaId,
boolean isThumbnail)
Gets a media File
|
long |
getNumArticles(String tool,
long topicId)
Gets the number of articles for the specified topic
|
int |
getNumberCommentForArticle(long articleId)
Gets the number of comments that has been placed on a article.
|
long |
getNumberRejectedArticles(String tool,
String userId)
Gets the number of rejected articles by the speified user.
|
long |
getNumberSavedArticles(String instance,
String userId,
boolean isEditor)
Gets the number of saved articles by the specified user.
|
long |
getNumberSubmittedArticles(String instance)
Gets the number of submitted articles
|
List<Article> |
getRejectedArticles(String tool,
String userId)
Gets the list of articles that are currently rejected for the specified user.
|
List<Article> |
getSavedArticles(String tool,
String userId,
boolean isEditor)
Gets the list of articles that are currently saved by the specified user.
|
List<Article> |
getSubmittedArticles(String tool)
Gets the list of articles that are currently submitted.
|
Topic |
getTopic(long topicId)
Gets the specific topic
|
List<Topic> |
getTopics()
Gets all the topics
|
Article |
maintainArticle(Article article)
Maintains the article in the database.
|
Media |
maintainMedia(Media media) |
void |
persistArticleRejection(ArticleRejection articleRejection)
Persists an ArticleRejection
|
Article |
removeMedia(Article article,
int mediaType)
Removes media from an article
|
void |
removeNotifications(String username)
Removes all wapad badge notifications for the specified user.
|
Category |
saveCategory(Category category)
Persists a category
|
Topic |
saveTopic(Topic topic)
Persists a topic
|
List<Article> |
searchArticles(String tool,
String searchText,
int from,
int fetchSize)
Searches for articles
|
long |
searchArticlesCount(String tool,
String searchText)
Returns the number of search results
|
String |
storeMedia(int mediaType,
String extention,
boolean isThumbnail,
InputStream inputStream)
Stores the specified media to the file system
|
Article |
updateMedia(Article article,
Media media)
Updates the media of an article
|
Media |
uploadMediaData(org.springframework.web.multipart.MultipartFile mediaFile,
int mediaType)
Uploads a media file
|
public WriterServiceImpl()
public Article getArticle(long articleId)
WriterServicegetArticle in interface WriterServicearticleId - Id if the article to getpublic long getNumberSavedArticles(String instance, String userId, boolean isEditor)
WriterServicegetNumberSavedArticles in interface WriterServicepublic long getNumberRejectedArticles(String tool, String userId)
WriterServicegetNumberRejectedArticles in interface WriterServicepublic long getNumberSubmittedArticles(String instance)
WriterServicegetNumberSubmittedArticles in interface WriterServicepublic List<Article> getSavedArticles(String tool, String userId, boolean isEditor)
WriterServicegetSavedArticles in interface WriterServicepublic List<Article> getRejectedArticles(String tool, String userId)
WriterServicegetRejectedArticles in interface WriterServicepublic List<Article> getSubmittedArticles(String tool)
WriterServicegetSubmittedArticles in interface WriterServicetool - Get the articles submitted for the writer instancepublic Comment addComment(Comment comment)
WriterServiceaddComment in interface WriterServicecomment - The comment to add.@Transactional public Article maintainArticle(Article article)
WriterServicemaintainArticle in interface WriterServicearticle - Article to maintainpublic List<Comment> getCommentsForArticle(long articleId)
WriterServicegetCommentsForArticle in interface WriterServicearticleId - Id of the article to get comments of.public int getNumberCommentForArticle(long articleId)
WriterServicegetNumberCommentForArticle in interface WriterServicearticleId - Id of the article to get the count of.public ArticleRejection getArticleRejection(long rejectionId)
WriterServicegetArticleRejection in interface WriterServicerejectionId - Id of the rejectionpublic Media getMedia(long mediaId)
WriterServicegetMedia in interface WriterServicepublic String storeMedia(int mediaType, String extention, boolean isThumbnail, InputStream inputStream)
WriterServicestoreMedia in interface WriterServicemediaType - Type of media to storeextention - Original extension of the mediaisThumbnail - Is this for a thumbnail?inputStream - The stream to the mediapublic Media maintainMedia(Media media)
maintainMedia in interface WriterServicepublic void persistArticleRejection(ArticleRejection articleRejection)
WriterServicepersistArticleRejection in interface WriterServicepublic List<Topic> getTopics()
WriterServicegetTopics in interface WriterServicepublic Topic getTopic(long topicId)
WriterServicegetTopic in interface WriterServicepublic Topic saveTopic(Topic topic)
WriterServicesaveTopic in interface WriterServicetopic - Topic to be persisted.public void deleteComment(long commentId)
WriterServicedeleteComment in interface WriterServicecommentId - ID of the comment to removepublic Article updateMedia(Article article, Media media)
WriterServiceupdateMedia in interface WriterServicearticle - Article to updatepublic Article removeMedia(Article article, int mediaType)
WriterServiceremoveMedia in interface WriterServicearticle - Article to updatepublic Media uploadMediaData(org.springframework.web.multipart.MultipartFile mediaFile, int mediaType)
WriterServiceuploadMediaData in interface WriterServicepublic long getNumArticles(String tool, long topicId)
WriterServicegetNumArticles in interface WriterServicetopicId - Topic to search inpublic List<Article> getArticles(String tool, long topicId, int from, int fetchSize)
WriterServicegetArticles in interface WriterServicetool - tool to get news oftopicId - Id of topic to get articles offrom - Starting row of resultsetfetchSize - Number of articles to retrievepublic void removeNotifications(String username)
WriterServiceremoveNotifications in interface WriterServiceusername - User to clear notifications ofpublic List<Article> searchArticles(String tool, String searchText, int from, int fetchSize)
WriterServicesearchArticles in interface WriterServicetool - tool to get news ofsearchText - Text to searchfrom - Starting row of resultsetfetchSize - Number of articles to retrievepublic long searchArticlesCount(String tool, String searchText)
WriterServicesearchArticlesCount in interface WriterServicetool - tool to get news ofpublic File getMediaFile(long mediaId, boolean isThumbnail) throws FileNotFoundException
WriterServicegetMediaFile in interface WriterServiceFileNotFoundExceptionpublic List<Category> getCategories()
WriterServicegetCategories in interface WriterServicepublic Category getCategory(long categoryId)
WriterServicegetCategory in interface WriterServicecategoryId - ID of the category to getpublic Category saveCategory(Category category)
WriterServicesaveCategory in interface WriterServicecategory - The category to persist.Copyright © 2011–2014 The Kuali Foundation. All rights reserved.