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)
WriterService
getArticle
in interface WriterService
articleId
- Id if the article to getpublic long getNumberSavedArticles(String instance, String userId, boolean isEditor)
WriterService
getNumberSavedArticles
in interface WriterService
public long getNumberRejectedArticles(String tool, String userId)
WriterService
getNumberRejectedArticles
in interface WriterService
public long getNumberSubmittedArticles(String instance)
WriterService
getNumberSubmittedArticles
in interface WriterService
public List<Article> getSavedArticles(String tool, String userId, boolean isEditor)
WriterService
getSavedArticles
in interface WriterService
public List<Article> getRejectedArticles(String tool, String userId)
WriterService
getRejectedArticles
in interface WriterService
public List<Article> getSubmittedArticles(String tool)
WriterService
getSubmittedArticles
in interface WriterService
tool
- Get the articles submitted for the writer instancepublic Comment addComment(Comment comment)
WriterService
addComment
in interface WriterService
comment
- The comment to add.@Transactional public Article maintainArticle(Article article)
WriterService
maintainArticle
in interface WriterService
article
- Article to maintainpublic List<Comment> getCommentsForArticle(long articleId)
WriterService
getCommentsForArticle
in interface WriterService
articleId
- Id of the article to get comments of.public int getNumberCommentForArticle(long articleId)
WriterService
getNumberCommentForArticle
in interface WriterService
articleId
- Id of the article to get the count of.public ArticleRejection getArticleRejection(long rejectionId)
WriterService
getArticleRejection
in interface WriterService
rejectionId
- Id of the rejectionpublic Media getMedia(long mediaId)
WriterService
getMedia
in interface WriterService
public String storeMedia(int mediaType, String extention, boolean isThumbnail, InputStream inputStream)
WriterService
storeMedia
in interface WriterService
mediaType
- 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 WriterService
public void persistArticleRejection(ArticleRejection articleRejection)
WriterService
persistArticleRejection
in interface WriterService
public List<Topic> getTopics()
WriterService
getTopics
in interface WriterService
public Topic getTopic(long topicId)
WriterService
getTopic
in interface WriterService
public Topic saveTopic(Topic topic)
WriterService
saveTopic
in interface WriterService
topic
- Topic to be persisted.public void deleteComment(long commentId)
WriterService
deleteComment
in interface WriterService
commentId
- ID of the comment to removepublic Article updateMedia(Article article, Media media)
WriterService
updateMedia
in interface WriterService
article
- Article to updatepublic Article removeMedia(Article article, int mediaType)
WriterService
removeMedia
in interface WriterService
article
- Article to updatepublic Media uploadMediaData(org.springframework.web.multipart.MultipartFile mediaFile, int mediaType)
WriterService
uploadMediaData
in interface WriterService
public long getNumArticles(String tool, long topicId)
WriterService
getNumArticles
in interface WriterService
topicId
- Topic to search inpublic List<Article> getArticles(String tool, long topicId, int from, int fetchSize)
WriterService
getArticles
in interface WriterService
tool
- 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)
WriterService
removeNotifications
in interface WriterService
username
- User to clear notifications ofpublic List<Article> searchArticles(String tool, String searchText, int from, int fetchSize)
WriterService
searchArticles
in interface WriterService
tool
- tool to get news ofsearchText
- Text to searchfrom
- Starting row of resultsetfetchSize
- Number of articles to retrievepublic long searchArticlesCount(String tool, String searchText)
WriterService
searchArticlesCount
in interface WriterService
tool
- tool to get news ofpublic File getMediaFile(long mediaId, boolean isThumbnail) throws FileNotFoundException
WriterService
getMediaFile
in interface WriterService
FileNotFoundException
public List<Category> getCategories()
WriterService
getCategories
in interface WriterService
public Category getCategory(long categoryId)
WriterService
getCategory
in interface WriterService
categoryId
- ID of the category to getpublic Category saveCategory(Category category)
WriterService
saveCategory
in interface WriterService
category
- The category to persist.Copyright © 2011–2014 The Kuali Foundation. All rights reserved.