org.exoplatform.faq.service
Interface FAQService

All Superinterfaces:
FAQServiceLegacy
All Known Implementing Classes:
FAQServiceImpl

public interface FAQService
extends FAQServiceLegacy

Created by The eXo Platform SARL.

FAQService is interface provide functions for processing database with category and question include: add, edit, remove and search categories or questions.

Since:
Mar 04, 2008
Author:
Hung Nguyen Quang hung.nguyen@exoplatform.com

Method Summary
 void addInitialDataPlugin(InitialDataPlugin plugin)
          Plugin to initialize default FAQ data
 void addLanguage(javax.jcr.Node questionNode, QuestionLanguage language)
          Add language for question node, this function only use for Question node, and language node is added not default.
 void addLanguage(String questionPath, QuestionLanguage language)
          Add language to a question
 void addListenerPlugin(AnswerEventListener listener)
          Add listener for answer
 void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
          Adds the plugin.
 void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
          Adds the plugin.
 void addWatchCategory(String id, Watch watch)
          This function is used to allow user can watch a category.
 void addWatchQuestion(String questionId, Watch watch, boolean isNew)
          Add watch for a question
 void calculateDeletedUser(String userName)
           
 void changeStatusCategoryView(List<String> listCateIds)
          This method should change view of category
 InputStream createAnswerRSS(String cateId)
          Create RSS for answer
 void deleteAnswer(String questionId, String answerId)
          Remove an answer
 void deleteAnswerQuestionLang(String questionPath, String answerId, String language)
          Delete language in a answer
 void deleteCategoryWatch(String categoryId, String user)
          This method will delete watch in one category
 void deleteComment(String questionId, String commentId)
          Remove comment of question
 void deleteCommentQuestionLang(String questionPath, String commentId, String language)
          Delete language in a comment
 long existingCategories()
          Get number of categories
 InputStream exportData(String categoryId, boolean createZipFile)
          Export category to stream
 List<Category> getAllCategories()
          This method should lookup all the category and convert to category object and return list of category object
 List<String> getAllFAQAdmin()
          Get all user is admin.
 QuestionPageList getAllQuestions()
          Get all questions
 QuestionPageList getAllQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
          Get all questions of the category.
 Answer getAnswerById(String questionId, String answerid)
          Get answer of question
 Answer getAnswerById(String questionPath, String answerid, String language)
          Get answer object
 Category getCategoryById(String categoryId)
          This method should lookup category via identify and convert to Category object and return
 long[] getCategoryInfo(String categoryId, FAQSetting setting)
          Get some informations of category: Lookup category node by category's id and count sub-categories and questions are contained in this category.
 CategoryInfo getCategoryInfo(String categoryPath, List<String> categoryIdScoped)
          Get informations about category
 String getCategoryNameOf(String categoryPath)
          Get name of category
 javax.jcr.Node getCategoryNodeById(String categoryId)
          Get category node
 List<String> getCategoryPath(String categoryId)
          This method return path of category identify
 String getCategoryPathOf(String id)
          get path of Category by id
 String getCategoryPathOfQuestion(String categoryId)
          Get path of question.
 Comment getCommentById(String questionId, String commentId)
          Get comment of question
 Comment getCommentById(String questionPath, String commentId, String language)
          Get Comment of question
 Comment[] getComments(String questionId)
          Get comments of a question
 List<String> getListCateIdByModerator(String user)
          Get all categories of user.
 QuestionPageList getListMailInWatch(String categoryId)
          Get email addresses that watch in a category
 QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, String currentUser)
          Get list of questions that user watches
 long getMaxindexCategory(String parentId)
          Get max index of categories
 org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
          Get informations about message
 String[] getModeratorsOf(String path)
          Get moderators of question or category
 JCRPageList getPageListAnswer(String questionId, boolean isSortByVote)
          Get answers of question
 JCRPageList getPageListComment(String questionId)
          Get comments of question
 String getParentCategoriesName(String path)
          Get name of parent category
 Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
          This method will get messages to send notify
 QuestionPageList getPendingQuestionsByCategory(String categoryId, FAQSetting faqSetting)
          Get list pending questions in a category
 Question getQuestionById(String questionId)
          Lookup the question node via identify, convert to question object and return
 List<String> getQuestionContents(List<String> paths)
          Get titles of questions
 QuestionLanguage getQuestionLanguageByLanguage(String questionPath, String language)
          Get language of question
 List<QuestionLanguage> getQuestionLanguages(String questionId)
          Get all language nodes of question node which have id is specified, with each language node get properties of them and set into QuestionLanguage object.
 javax.jcr.Node getQuestionNodeById(String path)
          Get question node
 QuestionPageList getQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
          Get questions are activagted and approved in the category.
 QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer)
          Get questions in list categories.
 QuestionPageList getQuestionsNotYetAnswer(String categoryId, boolean isApproved)
          Get all questisons not yet answered, the first get all questions which have property response is null (have not yet answer) then convert to list of question object
 List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer)
          Get quick questions
 Map<String,String> getRelationQuestion(List<String> paths)
          Get titles of questions active
 List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
          This method should lookup all the categories node so find category have user in moderators and convert to category object and return list of category object
 List<Category> getSubCategories(String categoryId, FAQSetting faqSetting, boolean isGetAll, List<String> userView)
          This method should lookup all sub-categories of a category and convert to category object and return list of category object
 byte[] getTemplate()
          Get template of questions
 FileAttachment getUserAvatar(String userName)
          Get avatar of user
 void getUserSetting(String userName, FAQSetting faqSetting)
          Get setting of user to view data (categories and questions).
 List<Watch> getWatchByCategory(String categoryId)
          Get list of watches
 QuestionPageList getWatchedCategoryByUser(String userId)
          Get list questions that user watches
 boolean hasWatch(String categoryPath)
          Get information has watch or not
 boolean importData(String categoryId, InputStream inputStream, boolean isZip)
          Import data to category
 boolean isAdminRole(String userName)
          Check permission of user
 boolean isCategoryExist(String name, String path)
          Check category is exist or not
 boolean isCategoryModerator(String categoryId, String user)
          Check user is moderator or not
 boolean isExisting(String path)
          Check a path exist or not
 boolean isModerateAnswer(String id)
          Check moderate answer or not
 boolean isModerateQuestion(String id)
          Check question has moderator or not
 boolean isUserWatched(String userId, String cateId)
          Check that user is watching a category
 boolean isViewAuthorInfo(String id)
          Check view author information or not
 List<Cate> listingCategoryTree()
          Get list of categories
 void moveCategory(String categoryId, String destCategoryId)
          This method should move a category.
 void moveQuestions(List<String> questions, String destCategoryId, String questionLink, FAQSetting faqSetting)
          Move all of questions to category which have id is specified
 Object readCategoryProperty(String categoryId, String propertyName, Class returnType)
          read property of the category by its name
 Object readQuestionProperty(String questionId, String propertyName, Class returnType)
          read property of the question by its name
 void reCalculateLastActivityOfQuestion(String absPathOfItem)
          Save last active information of question
 void removeCategory(String categoryId)
          This method should check exists of category and remove it
 void removeLanguage(String questionPath, List<String> listLanguage)
          Remove languages from question
 void removeQuestion(String questionId)
          Delete question by question's id.
 void saveAnswer(String questionId, Answer[] answers)
          Save an answer
 void saveAnswer(String questionId, Answer answer, boolean isNew)
          Save an answer
 void saveAnswer(String questionPath, Answer answer, String languge)
          Save an answer of question
 void saveAnswer(String questionPath, QuestionLanguage questionLanguage)
          Save an answer of question
 void saveCategory(String parentId, Category cat, boolean isAddNew)
          This method should check exists category or NOT to create new or update exists category
 void saveComment(String questionId, Comment comment, boolean isNew)
          Save comment of question
 void saveComment(String questionPath, Comment comment, String languge)
          Save comment of a question
 void saveFAQSetting(FAQSetting faqSetting, String userName)
          This method to update FAQ setting.
 javax.jcr.Node saveQuestion(Question question, boolean isAddNew, FAQSetting faqSetting)
          Save question after create new question or edit infor of quesiton which is existed.
 void saveTemplate(String str)
          Save a template
 void saveTopicIdDiscussQuestion(String questionId, String pathDiscuss)
          Save topic
 void saveUserAvatar(String userId, FileAttachment fileAttachment)
          Save avatar of an user
 void setDefaultAvatar(String userName)
          set default avatar for an user
 void swapCategories(String cateId1, String cateId2)
          Swap two categories
 void unVoteQuestion(String questionPath, String userName)
          Remove vote for question
 void unWatchCategory(String categoryId, String userCurrent)
          This method will un watch in one category
 void unWatchQuestion(String questionID, String userCurrent)
          This method will un watch in one question
 void updateQuestionRelatives(String questionPath, String[] relatives)
          Update relatives for a question
 void voteAnswer(String answerPath, String userName, boolean isUp)
          vote for an answer
 void voteQuestion(String questionPath, String userName, int number)
          vote for a question
 

Method Detail

addPlugin

void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
               throws Exception
Adds the plugin.

Parameters:
plugin - the plugin
Throws:
Exception - the exception

addInitialDataPlugin

void addInitialDataPlugin(InitialDataPlugin plugin)
                          throws Exception
Plugin to initialize default FAQ data

Parameters:
plugin -
Throws:
Exception

saveCategory

void saveCategory(String parentId,
                  Category cat,
                  boolean isAddNew)
This method should check exists category or NOT to create new or update exists category

This function is used to add new or edit category in list. User will input information of fields need in form add category, so user save then category will persistent in data

Parameters:
parentId - is address id of the category parent where user want add sub category when paretId = null so this category is parent category else sub category
cat - is properties that user input to interface will save on data
isAddNew - is true when add new category else update category
See Also:
category

changeStatusCategoryView

void changeStatusCategoryView(List<String> listCateIds)
                              throws Exception
This method should change view of category

Parameters:
listCateIds - is address ids of the category need to change
Throws:
Exception - the exception

removeCategory

void removeCategory(String categoryId)
                    throws Exception
This method should check exists of category and remove it

Parameters:
categoryId - is address id of the category need remove
Throws:
Exception - the exception

getCategoryById

Category getCategoryById(String categoryId)
                         throws Exception
This method should lookup category via identify and convert to Category object and return

Parameters:
categoryId - is address id of the category so you want get
Returns:
category is id = categoryId
Throws:
Exception - the exception
See Also:
category

getAllCategories

List<Category> getAllCategories()
                                throws Exception
This method should lookup all the category and convert to category object and return list of category object

Returns:
Category list
Throws:
Exception - the exception

getListCateIdByModerator

List<String> getListCateIdByModerator(String user)
                                      throws Exception
Get all categories of user. the first lookup all the categories, find categories which have user in moderators after that put this categories into a list category object

Parameters:
user - the name of user
Returns:
Category list
Throws:
Exception - if can't found user

getSubCategories

List<Category> getSubCategories(String categoryId,
                                FAQSetting faqSetting,
                                boolean isGetAll,
                                List<String> userView)
                                throws Exception
This method should lookup all sub-categories of a category and convert to category object and return list of category object

Parameters:
categoryId - the category id
userView - the list of users to view categories.
Returns:
Category list
Throws:
Exception - the exception

moveCategory

void moveCategory(String categoryId,
                  String destCategoryId)
                  throws Exception
This method should move a category.

Parameters:
categoryId - the category id should move
destCategoryId - : category is moved
Throws:
Exception - the exception

saveQuestion

javax.jcr.Node saveQuestion(Question question,
                            boolean isAddNew,
                            FAQSetting faqSetting)
                            throws Exception
Save question after create new question or edit infor of quesiton which is existed. If param isAddNew is true then create new question node and set properties of question object to this node else reset infor for this question node

Parameters:
question - the question
isAddNew - is true if create new question node and is false if edit question node
Returns:
the question node
Throws:
Exception - if path of question nod not found

removeQuestion

void removeQuestion(String questionId)
                    throws Exception
Delete question by question's id. Check question if it's existed then remove it

Parameters:
questionId - the id of question is deleted
Throws:
Exception - if question not found

getQuestionById

Question getQuestionById(String questionId)
                         throws Exception
Lookup the question node via identify, convert to question object and return

Parameters:
questionId - the question id
Returns:
Question
Throws:
Exception - the exception

getAllQuestions

QuestionPageList getAllQuestions()
                                 throws Exception
Get all questions

Returns:
List of question
Throws:
Exception - if attachment not foune

getQuestionsNotYetAnswer

QuestionPageList getQuestionsNotYetAnswer(String categoryId,
                                          boolean isApproved)
                                          throws Exception
Get all questisons not yet answered, the first get all questions which have property response is null (have not yet answer) then convert to list of question object

Returns:
List of question
Throws:
Exception - if lost attachment

getQuestionsByCatetory

QuestionPageList getQuestionsByCatetory(String categoryId,
                                        FAQSetting faqSetting)
                                        throws Exception
Get questions are activagted and approved in the category. The first get category from id which is specified by param categoryId then lookup questions of this category, only question is activated and approved via category identify, the last convert to list of question object

Parameters:
categoryId - the category id
Returns:
Question list
Throws:
Exception - if can't found category

getAllQuestionsByCatetory

QuestionPageList getAllQuestionsByCatetory(String categoryId,
                                           FAQSetting faqSetting)
                                           throws Exception
Get all questions of the category. The first get category from id which is specified by param categoryId then get all questions of this category and put them into an question page list object

Parameters:
categoryId - the id of category
Returns:
Question page list
Throws:
Exception - when category not found

getCategoryInfo

long[] getCategoryInfo(String categoryId,
                       FAQSetting setting)
                       throws Exception
Get some informations of category: Lookup category node by category's id and count sub-categories and questions are contained in this category.

Parameters:
categoryId - the category id
Returns:
number of sub-categories number of questions number of questions is not approved number of question is have not yet answered
Throws:
Exception - if not found category by id if not found question or lose file attach
Exception - the exception

getQuestionsByListCatetory

QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
                                            boolean isNotYetAnswer)
                                            throws Exception
Get questions in list categories.

With each category in the list categories, if isNotYetAnswer is false get all questoin in this catgory else get questions which is not yet answered, and put them in to a QuestionPageList object

Parameters:
listCategoryId - the list category id
isNotYetAnswer - is true if get qeustions not yet answered is false if want get all questions in list categories
Returns:
Question page list
Throws:
Exception - the exception

getCategoryPathOfQuestion

String getCategoryPathOfQuestion(String categoryId)
                                 throws Exception
Get path of question. For example question A is included in category C and C is child of category B, then, this function will be return C > B

Parameters:
categoryId - id of category is contain question
Returns:
name of categories
Throws:
Exception

getQuestionLanguages

List<QuestionLanguage> getQuestionLanguages(String questionId)
Get all language nodes of question node which have id is specified, with each language node get properties of them and set into QuestionLanguage object. One QuestionLanguage object have properties:

Parameters:
questionId - the id of question
Returns:
list languages are support by the question

moveQuestions

void moveQuestions(List<String> questions,
                   String destCategoryId,
                   String questionLink,
                   FAQSetting faqSetting)
                   throws Exception
Move all of questions to category which have id is specified

Parameters:
questions - the questions
destCategoryId - the dest category id
questionLink - the question link
faqSetting - the FAQSetting
Throws:
Exception - the exception

saveFAQSetting

void saveFAQSetting(FAQSetting faqSetting,
                    String userName)
                    throws Exception
This method to update FAQ setting.

Parameters:
newSetting - the new setting
Throws:
Exception - the exception

addWatchCategory

void addWatchCategory(String id,
                      Watch watch)
                      throws Exception
This function is used to allow user can watch a category. You have to register your email for whenever there is new question is inserted in the category or new category then there will a notification sent to you.

Parameters:
id - of category with user want add watch on that category
value, - this address email (multiple value) with input to interface will save on data
Throws:
Exception - the exception

deleteCategoryWatch

void deleteCategoryWatch(String categoryId,
                         String user)
                         throws Exception
This method will delete watch in one category

Parameters:
categoryId - is id of current category
emails - is location current of one watch with user want delete
Throws:
Exception - the exception

unWatchCategory

void unWatchCategory(String categoryId,
                     String userCurrent)
                     throws Exception
This method will un watch in one category

Parameters:
categoryId - is id of current category
userCurrent - is user current then you un watch
Throws:
Exception - the exception

unWatchQuestion

void unWatchQuestion(String questionID,
                     String userCurrent)
                     throws Exception
This method will un watch in one question

Parameters:
questionId - is id of current category
userCurrent - is user current then you un watch
Throws:
Exception - the exception

getSearchResults

List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
                                          throws Exception
This method should lookup all the categories node so find category have user in moderators and convert to category object and return list of category object

Parameters:
user - is name when user login
Returns:
Category list
Throws:
Exception - the exception

getCategoryPath

List<String> getCategoryPath(String categoryId)
                             throws Exception
This method return path of category identify

Parameters:
category - identify
Returns:
list category name is sort(path of this category)
Throws:
Exception - the exception

getPendingMessages

Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
This method will get messages to send notify


addLanguage

void addLanguage(javax.jcr.Node questionNode,
                 QuestionLanguage language)
                 throws Exception
Add language for question node, this function only use for Question node, and language node is added not default.

the first, get this language node if it's existed, opposite add new language node. Then set properties for this node: node's name, question's content and response's content.

Parameters:
questionNode - add language node for this question node
language - The QuestionLanguage object which is add for the question node, language object have some properties: name, question's content and response's content. Property response may be don't need setting value if question not yet answered
Throws:
Exception - the exception

getUserSetting

void getUserSetting(String userName,
                    FAQSetting faqSetting)
                    throws Exception
Get setting of user to view data (categories and questions). At first time user come, system will create setting for user (automatically) base on setting of admin (Default setting of FAQ system). After that, when user login again, his setting is getted.

Parameters:
userName - the name of user
faqSetting - the setting of user
Throws:
Exception - when can't find user or faqSetting

getMessageInfo

org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
                                                       throws Exception
Get informations about message

Parameters:
name - key of message
Returns:
informations contain message and email addresses.
Throws:
Exception

isAdminRole

boolean isAdminRole(String userName)
                    throws Exception
Check permission of user

Parameters:
userName - id or user name of user who is checked permission
Returns:
return true if user is admin. The current user is implied if userName is null.
Throws:
Exception

getAllFAQAdmin

List<String> getAllFAQAdmin()
                            throws Exception
Get all user is admin.

Throws:
Exception - the exception

addRolePlugin

void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                   throws Exception
Adds the plugin.

Parameters:
plugin - the plugin
Throws:
Exception - the exception

addWatchQuestion

void addWatchQuestion(String questionId,
                      Watch watch,
                      boolean isNew)
                      throws Exception
Add watch for a question

Parameters:
questionId - id of question
watch - contains information of users
isNew - add new or edit
Throws:
Exception

saveTopicIdDiscussQuestion

void saveTopicIdDiscussQuestion(String questionId,
                                String pathDiscuss)
                                throws Exception
Save topic

Parameters:
questionId - Question to discuss
pathDiscuss - path to discussion
Throws:
Exception

getListQuestionsWatch

QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                       String currentUser)
                                       throws Exception
Get list of questions that user watches

Parameters:
faqSetting - setting of user
currentUser - username
Returns:
List of questions
Throws:
Exception

getCategoryNodeById

javax.jcr.Node getCategoryNodeById(String categoryId)
                                   throws Exception
Get category node

Parameters:
categoryId - id of category
Returns:
node of category
Throws:
Exception

importData

boolean importData(String categoryId,
                   InputStream inputStream,
                   boolean isZip)
                   throws Exception
Import data to category

Parameters:
name - key of message
Returns:
informations contain message and email addresses.
Throws:
Exception

swapCategories

void swapCategories(String cateId1,
                    String cateId2)
                    throws Exception
Swap two categories

Parameters:
cateId1 - id of category 1
cateId2 - id of category 2
Throws:
Exception

getMaxindexCategory

long getMaxindexCategory(String parentId)
                         throws Exception
Get max index of categories

Parameters:
parentId - id of parent
Returns:
index
Throws:
Exception

deleteAnswer

void deleteAnswer(String questionId,
                  String answerId)
                  throws Exception
Remove an answer

Parameters:
questionId - id of question
answerId - id of answer
Throws:
Exception

deleteComment

void deleteComment(String questionId,
                   String commentId)
                   throws Exception
Remove comment of question

Parameters:
questionId - id of question
commentId - id of comment
Throws:
Exception

saveAnswer

void saveAnswer(String questionId,
                Answer answer,
                boolean isNew)
                throws Exception
Save an answer

Parameters:
questionId - id of question
answer - saved answer
isNew - save new or edit
Throws:
Exception

saveComment

void saveComment(String questionId,
                 Comment comment,
                 boolean isNew)
                 throws Exception
Save comment of question

Parameters:
questionId - id of question
comment - saved comment
isNew - save new or edit
Throws:
Exception

getCommentById

Comment getCommentById(String questionId,
                       String commentId)
                       throws Exception
Get comment of question

Parameters:
questionId - id of question
commentId - id of comment
Returns:
comment
Throws:
Exception

getAnswerById

Answer getAnswerById(String questionId,
                     String answerid)
                     throws Exception
Get answer of question

Parameters:
questionId - id of question
answerid - id of answer
Returns:
an Answer
Throws:
Exception

saveAnswer

void saveAnswer(String questionId,
                Answer[] answers)
                throws Exception
Save an answer

Parameters:
questionId - id of question
answers - saved answers
Throws:
Exception

getPageListComment

JCRPageList getPageListComment(String questionId)
                               throws Exception
Get comments of question

Parameters:
questionId - id of question
Returns:
comment page list
Throws:
Exception

getPageListAnswer

JCRPageList getPageListAnswer(String questionId,
                              boolean isSortByVote)
                              throws Exception
Get answers of question

Parameters:
questionId - id of question
isSortByVote - sort by vote
Returns:
answers page list
Throws:
Exception

getWatchedCategoryByUser

QuestionPageList getWatchedCategoryByUser(String userId)
                                          throws Exception
Get list questions that user watches

Parameters:
userId - username
Returns:
question page list
Throws:
Exception

getUserAvatar

FileAttachment getUserAvatar(String userName)
                             throws Exception
Get avatar of user

Parameters:
userName - username
Returns:
avatar of user
Throws:
Exception

saveUserAvatar

void saveUserAvatar(String userId,
                    FileAttachment fileAttachment)
                    throws Exception
Save avatar of an user

Parameters:
userId - username
fileAttachment - avatar of user
Throws:
Exception

isUserWatched

boolean isUserWatched(String userId,
                      String cateId)
Check that user is watching a category

Parameters:
userId - username
cateId - id of category
Returns:
true if user is watching and false if isn't
Throws:
Exception

setDefaultAvatar

void setDefaultAvatar(String userName)
                      throws Exception
set default avatar for an user

Parameters:
userName - username
Throws:
Exception

getPendingQuestionsByCategory

QuestionPageList getPendingQuestionsByCategory(String categoryId,
                                               FAQSetting faqSetting)
                                               throws Exception
Get list pending questions in a category

Parameters:
categoryId - id of category
faqSetting - settings
Returns:
question page list
Throws:
Exception

exportData

InputStream exportData(String categoryId,
                       boolean createZipFile)
                       throws Exception
Export category to stream

Parameters:
categoryId - id of category
createZipFile - create zip file or not
Returns:
input stream of category
Throws:
Exception

isExisting

boolean isExisting(String path)
                   throws Exception
Check a path exist or not

Parameters:
path - path need check
Returns:
exist or not
Throws:
Exception

getCategoryPathOf

String getCategoryPathOf(String id)
                         throws Exception
get path of Category by id

Parameters:
id - category id
Returns:
path of category
Throws:
Exception

getRelationQuestion

Map<String,String> getRelationQuestion(List<String> paths)
                                       throws Exception
Get titles of questions active

Parameters:
paths - path of questions
Returns:
list titles of questions
Throws:
Exception

getQuestionContents

List<String> getQuestionContents(List<String> paths)
                                 throws Exception
Get titles of questions

Parameters:
paths - path of questions
Returns:
list titles of questions
Throws:
Exception

isModerateAnswer

boolean isModerateAnswer(String id)
                         throws Exception
Check moderate answer or not

Parameters:
id - id of category
Returns:
answer or not
Throws:
Exception

getQuestionNodeById

javax.jcr.Node getQuestionNodeById(String path)
                                   throws Exception
Get question node

Parameters:
path - id of question
Returns:
question node
Throws:
Exception

getParentCategoriesName

String getParentCategoriesName(String path)
                               throws Exception
Get name of parent category

Parameters:
path - id of category
Returns:
name of parent category
Throws:
Exception

getListMailInWatch

QuestionPageList getListMailInWatch(String categoryId)
                                    throws Exception
Get email addresses that watch in a category

Parameters:
categoryId - id of category
Returns:
question page list
Throws:
Exception

isCategoryModerator

boolean isCategoryModerator(String categoryId,
                            String user)
                            throws Exception
Check user is moderator or not

Parameters:
categoryId - id of category
user - username
Returns:
user is moderator or not. The current user is implied if user is null.
Throws:
Exception

addLanguage

void addLanguage(String questionPath,
                 QuestionLanguage language)
                 throws Exception
Add language to a question

Parameters:
questionPath - patch of question
language - question language
Throws:
Exception

deleteAnswerQuestionLang

void deleteAnswerQuestionLang(String questionPath,
                              String answerId,
                              String language)
                              throws Exception
Delete language in a answer

Parameters:
questionPath - path of question
answerId - id of answer
language - deleted language
Throws:
Exception

deleteCommentQuestionLang

void deleteCommentQuestionLang(String questionPath,
                               String commentId,
                               String language)
                               throws Exception
Delete language in a comment

Parameters:
questionPath - path of question
commentId - id of comment
language - deleted language
Throws:
Exception

getQuestionLanguageByLanguage

QuestionLanguage getQuestionLanguageByLanguage(String questionPath,
                                               String language)
                                               throws Exception
Get language of question

Parameters:
questionPath - path of question
language - got language
Returns:
Language of question
Throws:
Exception

getCommentById

Comment getCommentById(String questionPath,
                       String commentId,
                       String language)
                       throws Exception
Get Comment of question

Parameters:
questionPath - path of question
commentId - id of comment
language -
Returns:
comment of question
Throws:
Exception

getAnswerById

Answer getAnswerById(String questionPath,
                     String answerid,
                     String language)
                     throws Exception
Get answer object

Parameters:
questionPath - path of question
answerid - id of answer
language -
Returns:
answer has inputed id
Throws:
Exception

saveAnswer

void saveAnswer(String questionPath,
                Answer answer,
                String languge)
                throws Exception
Save an answer of question

Parameters:
questionPath - path of question
answer - object answer want to save
languge - language of answer
Throws:
Exception

saveAnswer

void saveAnswer(String questionPath,
                QuestionLanguage questionLanguage)
                throws Exception
Save an answer of question

Parameters:
questionPath - path of question
questionLanguage - language of answer
Throws:
Exception

saveComment

void saveComment(String questionPath,
                 Comment comment,
                 String languge)
                 throws Exception
Save comment of a question

Parameters:
questionPath - path of question
comment - comment want to save
languge - language of comment
Throws:
Exception

removeLanguage

void removeLanguage(String questionPath,
                    List<String> listLanguage)
Remove languages from question

Parameters:
questionPath - path of question
listLanguage - removed languages
Throws:
Exception

voteAnswer

void voteAnswer(String answerPath,
                String userName,
                boolean isUp)
                throws Exception
vote for an answer

Parameters:
answerPath - path of answer
userName - username of user vote for answer
isUp - up or not
Throws:
Exception

voteQuestion

void voteQuestion(String questionPath,
                  String userName,
                  int number)
                  throws Exception
vote for a question

Parameters:
questionPath - path of question
userName - username of user vote for question
number - value user vote
Throws:
Exception

getModeratorsOf

String[] getModeratorsOf(String path)
                         throws Exception
Get moderators of question or category

Parameters:
path - path of question or category
Returns:
array users are moderator
Throws:
Exception

unVoteQuestion

void unVoteQuestion(String questionPath,
                    String userName)
                    throws Exception
Remove vote for question

Parameters:
questionPath - path of question
userName - username remove vote
Throws:
Exception

isViewAuthorInfo

boolean isViewAuthorInfo(String id)
Check view author information or not

Parameters:
id - id of question
Returns:
is view author information or not

existingCategories

long existingCategories()
                        throws Exception
Get number of categories

Returns:
number of categories
Throws:
Exception

getCategoryNameOf

String getCategoryNameOf(String categoryPath)
                         throws Exception
Get name of category

Parameters:
categoryPath - path of category
Returns:
name of category
Throws:
Exception

getQuickQuestionsByListCatetory

List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId,
                                               boolean isNotYetAnswer)
                                               throws Exception
Get quick questions

Parameters:
listCategoryId - id of some categories
isNotYetAnswer - is answer or not
Returns:
list of questions
Throws:
Exception

listingCategoryTree

List<Cate> listingCategoryTree()
                               throws Exception
Get list of categories

Returns:
list of categories
Throws:
Exception

getWatchByCategory

List<Watch> getWatchByCategory(String categoryId)
                               throws Exception
Get list of watches

Parameters:
categoryId - id of category
Returns:
list of watches in a category
Throws:
Exception

hasWatch

boolean hasWatch(String categoryPath)
Get information has watch or not

Parameters:
categoryPath - path of category
Returns:
has watch or has not
Throws:
Exception

getCategoryInfo

CategoryInfo getCategoryInfo(String categoryPath,
                             List<String> categoryIdScoped)
                             throws Exception
Get informations about category

Parameters:
categoryPath - path of category
categoryIdScoped - list sub of category
Returns:
informations in CategoryInfo object
Throws:
Exception

getTemplate

byte[] getTemplate()
                   throws Exception
Get template of questions

Returns:
template
Throws:
Exception

saveTemplate

void saveTemplate(String str)
                  throws Exception
Save a template

Parameters:
str - template
Throws:
Exception

isCategoryExist

boolean isCategoryExist(String name,
                        String path)
Check category is exist or not

Parameters:
name - name of category
path - path of category
Returns:
is exist or not
Throws:
Exception

updateQuestionRelatives

void updateQuestionRelatives(String questionPath,
                             String[] relatives)
                             throws Exception
Update relatives for a question

Parameters:
questionPath - path of question
relatives - input relatives
Throws:
Exception

isModerateQuestion

boolean isModerateQuestion(String id)
                           throws Exception
Check question has moderator or not

Parameters:
id - id of question
Returns:
is moderate or not
Throws:
Exception

createAnswerRSS

InputStream createAnswerRSS(String cateId)
                            throws Exception
Create RSS for answer

Parameters:
cateId - id of category
Returns:
stream of answer rss
Throws:
Exception

reCalculateLastActivityOfQuestion

void reCalculateLastActivityOfQuestion(String absPathOfItem)
                                       throws Exception
Save last active information of question

Parameters:
absPathOfItem - path of question
Throws:
Exception

addListenerPlugin

void addListenerPlugin(AnswerEventListener listener)
                       throws Exception
Add listener for answer

Parameters:
listener - answer event listener
Throws:
Exception

getComments

Comment[] getComments(String questionId)
                      throws Exception
Get comments of a question

Parameters:
questionId - id of question
Returns:
comments of question
Throws:
Exception

calculateDeletedUser

void calculateDeletedUser(String userName)
                          throws Exception
Throws:
Exception

readCategoryProperty

Object readCategoryProperty(String categoryId,
                            String propertyName,
                            Class returnType)
                            throws Exception
read property of the category by its name

Parameters:
categoryId - id of the category
propertyName - name of the property
returnType - expected return-type. The supported class are String[], String, Long, Boolean, Double and Date .
Returns:
Throws:
Exception

readQuestionProperty

Object readQuestionProperty(String questionId,
                            String propertyName,
                            Class returnType)
                            throws Exception
read property of the question by its name

Parameters:
questionId - id of the question
propertyName - name of the property
returnType - expected return-type. The supported class are String[], String, Long, Boolean, Double and Date.
Returns:
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.