org.exoplatform.faq.service
Interface FAQService

All Superinterfaces:
FAQServiceLegacy
All Known Implementing Classes:
FAQServiceImpl

public interface FAQService
extends FAQServiceLegacy

APIs for FAQ and all other related objects (Categories, Questions and Answers) operations.


Method Summary
 void addInitialDataPlugin(InitialDataPlugin plugin)
          Adds plugin to initialize default FAQ data.
 void addLanguage(javax.jcr.Node questionNode, QuestionLanguage language)
          Adds language for question node, this function only use for Question node, and language node is added not default.
 void addLanguage(String questionPath, QuestionLanguage language)
          Adds language to a question.
 void addListenerPlugin(AnswerEventListener listener)
          Adds 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)
          Adds watch a category.
 void addWatchQuestion(String questionId, Watch watch, boolean isNew)
          Adds watch for a question.
 CategoryTree buildCategoryTree(String categoryId)
          Builds category tree of provided id.
 void calculateDeletedUser(String userName)
          Calculates deleted user.
 void changeStatusCategoryView(List<String> listCateIds)
          Changes status of view of category.
 InputStream createAnswerRSS(String cateId)
          Creates RSS for answer.
 void deleteAnswer(String questionId, String answerId)
          Removes an answer.
 void deleteAnswerQuestionLang(String questionPath, String answerId, String language)
          Deletes language in a answer.
 void deleteCategoryWatch(String categoryId, String user)
          Deletes watch in one category.
 void deleteComment(String questionId, String commentId)
          Removes comment of question.
 void deleteCommentQuestionLang(String questionPath, String commentId, String language, boolean isPromoted)
          Deletes language in a comment.
 long existingCategories()
          Gets number of categories.
 InputStream exportData(String categoryId, boolean createZipFile)
          Exports category to stream.
 String getActivityIdForAnswer(String ownerPath, Answer answer)
          Gets value of exo:activityId property in answer node via path.
 String getActivityIdForComment(String ownerPath, String commentId, String language)
          Gets value of exo:activityId property in comment node base on provided path.
 String getActivityIdForQuestion(String ownerPath)
          Gets value of exo:activityId property in question node via path.
 List<Category> getAllCategories()
          Gets all categories.
 List<String> getAllFAQAdmin()
          Gets all user is administration.
 QuestionPageList getAllQuestions()
          Gets all questions
 QuestionPageList getAllQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
          Gets all questions of the category.
 Answer getAnswerById(String questionId, String answerid)
          Gets answer of question.
 Answer getAnswerById(String questionPath, String answerid, String language)
          Gets answer object.
 Category getCategoryById(String categoryId)
          Gets category by id.
 long[] getCategoryInfo(String categoryId, FAQSetting setting)
          Gets 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)
          Gets informations about category.
 String getCategoryNameOf(String categoryPath)
          Gets name of category.
 javax.jcr.Node getCategoryNodeById(String categoryId)
          Gets category node.
 List<String> getCategoryPath(String categoryId)
          Gets path of category by category id.
 String getCategoryPathOf(String id)
          Gets path of Category by id.
 String getCategoryPathOfQuestion(String categoryId)
          Gets path of question.
 Comment getCommentById(String questionId, String commentId)
          Gets comment of question.
 Comment getCommentById(String questionPath, String commentId, String language)
          Gets Comment of question.
 Comment[] getComments(String questionId)
          Gets comments of a question.
 List<String> getListCateIdByModerator(String user)
          Get all categories of specific provided user.
 QuestionPageList getListMailInWatch(String categoryId)
          Gets email addresses that watch in a category.
 QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, String currentUser)
          Gets list of questions that user watches.
 long getMaxindexCategory(String parentId)
          Gets max index of categories.
 org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
          Gets informations about message.
 String[] getModeratorsOf(String path)
          Gets moderators of question or category.
 JCRPageList getPageListAnswer(String questionId, boolean isSortByVote)
          Gets answers of question.
 JCRPageList getPageListComment(String questionId)
          Gets comments of question.
 String getParentCategoriesName(String path)
          Gets name of parent category.
 Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
          Gets messages to send notify.
 QuestionPageList getPendingQuestionsByCategory(String categoryId, FAQSetting faqSetting)
          Gets list pending questions in a category.
 Question getQuestionById(String questionId)
          Gets a question by id.
 List<String> getQuestionContents(List<String> paths)
          Gets titles of questions.
 QuestionLanguage getQuestionLanguageByLanguage(String questionPath, String language)
          Gets language of question.
 List<QuestionLanguage> getQuestionLanguages(String questionId)
          Gets 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)
          Gets question node.
 QuestionPageList getQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
          Gets questions are activated and approved in the category.
 QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer)
          Gets questions in list categories.
 QuestionPageList getQuestionsNotYetAnswer(String categoryId, boolean isApproved)
          Gets all questions 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)
          Gets quick questions.
 Map<String,String> getRelationQuestion(List<String> paths)
          Gets titles of questions active.
 List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
          Searches FAQs by event query.
 List<Category> getSubCategories(String categoryId, FAQSetting faqSetting, boolean isGetAll, List<String> userView)
          Gets all sub-categories of a category.
 byte[] getTemplate()
          Gets template of questions.
 FileAttachment getUserAvatar(String userName)
          Gets avatar of user.
 void getUserSetting(String userName, FAQSetting faqSetting)
          Gets setting of user to view data (categories and questions).
 List<Watch> getWatchByCategory(String categoryId)
          Gets list of watches.
 QuestionPageList getWatchedCategoryByUser(String userId)
          Get list questions that user watches
 boolean hasWatch(String categoryPath)
          Gets information has watch or not.
 boolean importData(String categoryId, InputStream inputStream, boolean isZip)
          Imports data to category.
 boolean isAdminRole(String userName)
          Checks permission of user.
 boolean isCategoryExist(String name, String path)
          Checks category is exist or not.
 boolean isCategoryModerator(String categoryId, String user)
          Checks user is moderator or not.
 boolean isExisting(String path)
          Checks a path exist or not.
 boolean isModerateAnswer(String id)
          Checks moderate answer or not.
 boolean isModerateQuestion(String id)
          Checks question has moderator or not.
 boolean isUserWatched(String userId, String cateId)
          Checks that user is watching a category.
 boolean isViewAuthorInfo(String id)
          Checks view author information or not.
 List<Cate> listingCategoryTree()
          Gets list of categories.
 void moveCategory(String categoryId, String destCategoryId)
          Moves a category to another one.
 void moveQuestions(List<String> questions, String destCategoryId, String questionLink, FAQSetting faqSetting)
          Moves all of questions to category which have id is specified.
 Object readCategoryProperty(String categoryId, String propertyName, Class returnType)
          Reads property of the category by its name.
 Object readQuestionProperty(String questionId, String propertyName, Class returnType)
          Reads property of the question by its name.
 void reCalculateLastActivityOfQuestion(String absPathOfItem)
          Saves last active information of question.
 void removeCategory(String categoryId)
          Removes specific category by provided id.
 void removeLanguage(String questionPath, List<String> listLanguage)
          Removes languages from question.
 void removeListenerPlugin(AnswerEventListener listener)
          Removes listener for answer.
 void removeQuestion(String questionId)
          Deletes question by question's id.
 void saveActivityIdForAnswer(String ownerPath, Answer answer, String activityId)
          Defines Mixin type exo:activityInfo for answer node that means to add exo:activityId property into Node what is owner created activity via patch
 void saveActivityIdForComment(String ownerPath, String commentId, String language, String activityId)
          Defines Mixin type exo:activityInfo for comment node that means to add exo:activityId property into Node what is owner created activity base on provided path.
 void saveActivityIdForQuestion(String ownerPath, String activityId)
          Defines Mixin type exo:activityInfo for question node that means to add exo:activityId property into Node what is owner created activity via patch
 void saveAnswer(String questionId, Answer[] answers)
          Saves an answer.
 void saveAnswer(String questionId, Answer answer, boolean isNew)
          Saves an answer.
 void saveAnswer(String questionPath, Answer answer, String languge)
          Saves an answer of question.
 void saveAnswer(String questionPath, QuestionLanguage questionLanguage)
          Saves 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)
          Saves comment of question.
 void saveComment(String questionPath, Comment comment, String languge)
          Saves comment of a question.
 void saveFAQSetting(FAQSetting faqSetting, String userName)
          Updates FAQ setting information.
 javax.jcr.Node saveQuestion(Question question, boolean isAddNew, FAQSetting faqSetting)
          Saves question after create new question or edit infor of quesiton which is existed.
 void saveTemplate(String str)
          Saves a template.
 void saveTopicIdDiscussQuestion(String questionId, String pathDiscuss)
          Saves topic.
 void saveUserAvatar(String userId, FileAttachment fileAttachment)
          Saves avatar of an user.
 void setDefaultAvatar(String userName)
          Sets default avatar for an user.
 void swapCategories(String cateId1, String cateId2)
          Swaps two categories.
 void unVoteQuestion(String questionPath, String userName)
          Removes vote for question.
 void unWatchCategory(String categoryId, String userCurrent)
          Un-watches in one category.
 void unWatchQuestion(String questionID, String userCurrent)
          Un-watches one question.
 void updateQuestionRelatives(String questionPath, String[] relatives)
          Updates relatives for a question.
 void voteAnswer(String answerPath, String userName, boolean isUp)
          Votes for an answer.
 void voteQuestion(String questionPath, String userName, int number)
          Votes 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
Adds 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

buildCategoryTree

CategoryTree buildCategoryTree(String categoryId)
                               throws Exception
Builds category tree of provided id.

Parameters:
categoryId - Id of category to build tree.
Returns:
the CategoryTree
Throws:
Exception

changeStatusCategoryView

void changeStatusCategoryView(List<String> listCateIds)
                              throws Exception
Changes status of 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
Removes specific category by provided id.

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

getCategoryById

Category getCategoryById(String categoryId)
                         throws Exception
Gets category by id.

Parameters:
categoryId - is address id of the category so you want get
Returns:
The category of specific provided id.
Throws:
Exception - the exception

getAllCategories

List<Category> getAllCategories()
                                throws Exception
Gets all categories.

Returns:
Category list
Throws:
Exception - the exception

getListCateIdByModerator

List<String> getListCateIdByModerator(String user)
                                      throws Exception
Get all categories of specific provided user.

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
Gets all sub-categories of a category.

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

moveCategory

void moveCategory(String categoryId,
                  String destCategoryId)
                  throws Exception
Moves a category to another one.

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
Saves 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
faqSetting - Setting FAQ information
Returns:
the question node
Throws:
Exception - if path of question nod not found

removeQuestion

void removeQuestion(String questionId)
                    throws Exception
Deletes 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
Gets a question by id.

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

getAllQuestions

QuestionPageList getAllQuestions()
                                 throws Exception
Gets all questions

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

getQuestionsNotYetAnswer

QuestionPageList getQuestionsNotYetAnswer(String categoryId,
                                          boolean isApproved)
                                          throws Exception
Gets all questions 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

Parameters:
categoryId - the id of category
isApproved - Question approved or not
Returns:
List of question
Throws:
Exception - if lost attachment

getQuestionsByCatetory

QuestionPageList getQuestionsByCatetory(String categoryId,
                                        FAQSetting faqSetting)
                                        throws Exception
Gets questions are activated 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
faqSetting - FAQ setting information
Returns:
Question list
Throws:
Exception - if can't found category

getAllQuestionsByCatetory

QuestionPageList getAllQuestionsByCatetory(String categoryId,
                                           FAQSetting faqSetting)
                                           throws Exception
Gets 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
faqSetting - FAQ setting information
Returns:
Question page list
Throws:
Exception - when category not found

getCategoryInfo

long[] getCategoryInfo(String categoryId,
                       FAQSetting setting)
                       throws Exception
Gets 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
setting - FAQ setting information
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
Gets 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
Gets 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)
Gets 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
Moves 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
Updates FAQ setting information.

Parameters:
faqSetting - FAQ setting information
userName - name of user who setting
Throws:
Exception - the exception

addWatchCategory

void addWatchCategory(String id,
                      Watch watch)
                      throws Exception
Adds 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
watch - added watch object
Throws:
Exception - the exception

deleteCategoryWatch

void deleteCategoryWatch(String categoryId,
                         String user)
                         throws Exception
Deletes watch in one category.

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

unWatchCategory

void unWatchCategory(String categoryId,
                     String userCurrent)
                     throws Exception
Un-watches in one category.

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

unWatchQuestion

void unWatchQuestion(String questionID,
                     String userCurrent)
                     throws Exception
Un-watches 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
Searches FAQs by event query.

Parameters:
eventQuery - Search condition
Returns:
FAQs that match the search condition.
Throws:
Exception

getCategoryPath

List<String> getCategoryPath(String categoryId)
                             throws Exception
Gets path of category by category id.

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

getPendingMessages

Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
Gets messages to send notify.


addLanguage

void addLanguage(javax.jcr.Node questionNode,
                 QuestionLanguage language)
                 throws Exception
Adds 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
Gets 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
Gets informations about message.

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

isAdminRole

boolean isAdminRole(String userName)
                    throws Exception
Checks 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
Gets all user is administration.

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
Adds 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
Saves topic.

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

getListQuestionsWatch

QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                       String currentUser)
                                       throws Exception
Gets 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
Gets category node.

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

importData

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

Parameters:
categoryId - the id of category
inputStream - the data
isZip - data is zip or not
Returns:
informations contain message and email addresses.
Throws:
Exception

swapCategories

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

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

getMaxindexCategory

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

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

deleteAnswer

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

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

deleteComment

void deleteComment(String questionId,
                   String commentId)
                   throws Exception
Removes 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
Saves 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
Saves 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
Gets 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
Gets 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
Saves an answer.

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

getPageListComment

JCRPageList getPageListComment(String questionId)
                               throws Exception
Gets comments of question.

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

getPageListAnswer

JCRPageList getPageListAnswer(String questionId,
                              boolean isSortByVote)
                              throws Exception
Gets 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
Gets avatar of user.

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

saveUserAvatar

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

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

isUserWatched

boolean isUserWatched(String userId,
                      String cateId)
Checks 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
Sets default avatar for an user.

Parameters:
userName - username
Throws:
Exception

getPendingQuestionsByCategory

QuestionPageList getPendingQuestionsByCategory(String categoryId,
                                               FAQSetting faqSetting)
                                               throws Exception
Gets 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
Exports 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
Checks a path exist or not.

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

getCategoryPathOf

String getCategoryPathOf(String id)
                         throws Exception
Gets 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
Gets 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
Gets titles of questions.

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

isModerateAnswer

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

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

getQuestionNodeById

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

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

getParentCategoriesName

String getParentCategoriesName(String path)
                               throws Exception
Gets name of parent category.

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

getListMailInWatch

QuestionPageList getListMailInWatch(String categoryId)
                                    throws Exception
Gets 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
Checks 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
Adds 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
Deletes 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,
                               boolean isPromoted)
                               throws Exception
Deletes language in a comment.

Parameters:
questionPath - path of question
commentId - id of comment
language - deleted language
isPromoted - true in case a comment is promoted to an answer
Throws:
Exception

getQuestionLanguageByLanguage

QuestionLanguage getQuestionLanguageByLanguage(String questionPath,
                                               String language)
                                               throws Exception
Gets 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
Gets 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
Gets 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
Saves 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
Saves 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
Saves 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)
Removes languages from question.

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

voteAnswer

void voteAnswer(String answerPath,
                String userName,
                boolean isUp)
                throws Exception
Votes 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
Votes 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
Gets 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
Removes vote for question.

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

isViewAuthorInfo

boolean isViewAuthorInfo(String id)
Checks view author information or not.

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

existingCategories

long existingCategories()
                        throws Exception
Gets number of categories.

Returns:
number of categories
Throws:
Exception

getCategoryNameOf

String getCategoryNameOf(String categoryPath)
                         throws Exception
Gets 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
Gets 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
Gets list of categories.

Returns:
list of categories
Throws:
Exception

getWatchByCategory

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

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

hasWatch

boolean hasWatch(String categoryPath)
Gets 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
Gets 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
Gets template of questions.

Returns:
template
Throws:
Exception

saveTemplate

void saveTemplate(String str)
                  throws Exception
Saves a template.

Parameters:
str - template
Throws:
Exception

isCategoryExist

boolean isCategoryExist(String name,
                        String path)
Checks 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
Updates relatives for a question.

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

isModerateQuestion

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

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

createAnswerRSS

InputStream createAnswerRSS(String cateId)
                            throws Exception
Creates RSS for answer.

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

reCalculateLastActivityOfQuestion

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

Parameters:
absPathOfItem - path of question
Throws:
Exception

addListenerPlugin

void addListenerPlugin(AnswerEventListener listener)
                       throws Exception
Adds listener for answer.

Parameters:
listener - answer event listener
Throws:
Exception

removeListenerPlugin

void removeListenerPlugin(AnswerEventListener listener)
                          throws Exception
Removes listener for answer.

Parameters:
listener - answer event listener
Throws:
Exception

getComments

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

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

calculateDeletedUser

void calculateDeletedUser(String userName)
                          throws Exception
Calculates deleted user.

Parameters:
userName -
Throws:
Exception

readCategoryProperty

Object readCategoryProperty(String categoryId,
                            String propertyName,
                            Class returnType)
                            throws Exception
Reads 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:
Object contains property values of category.
Throws:
Exception

readQuestionProperty

Object readQuestionProperty(String questionId,
                            String propertyName,
                            Class returnType)
                            throws Exception
Reads 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:
Object contains property values of question.
Throws:
Exception

saveActivityIdForQuestion

void saveActivityIdForQuestion(String ownerPath,
                               String activityId)
Defines Mixin type exo:activityInfo for question node that means to add exo:activityId property into Node what is owner created activity via patch

Parameters:
ownerPath - - the Path's Node what is owner created activity
activityId - - the Id's activity created.
Since:
4.0

getActivityIdForQuestion

String getActivityIdForQuestion(String ownerPath)
Gets value of exo:activityId property in question node via path. If property is not existing then return null.

Parameters:
ownerPath - - the Path's Node what is owner created activity
Returns:
String - the Id's activity created.
Since:
4.0

saveActivityIdForAnswer

void saveActivityIdForAnswer(String ownerPath,
                             Answer answer,
                             String activityId)
Defines Mixin type exo:activityInfo for answer node that means to add exo:activityId property into Node what is owner created activity via patch

Parameters:
ownerPath - - the Path's Node what is owner created activity
answer -
activityId - - the Id's activity created.
Since:
4.0

getActivityIdForAnswer

String getActivityIdForAnswer(String ownerPath,
                              Answer answer)
Gets value of exo:activityId property in answer node via path. If property is not existing then return null.

Parameters:
ownerPath - - the Path's Node what is owner created activity
answer -
Returns:
String - the Id's activity created.
Since:
4.0

saveActivityIdForComment

void saveActivityIdForComment(String ownerPath,
                              String commentId,
                              String language,
                              String activityId)
Defines Mixin type exo:activityInfo for comment node that means to add exo:activityId property into Node what is owner created activity base on provided path.

Parameters:
ownerPath - - the Path's Node what is owner created activity
commentId - - the id of comment posted for the question
language - - the language of comment
activityId - - the Id's activity created.
Since:
4.0

getActivityIdForComment

String getActivityIdForComment(String ownerPath,
                               String commentId,
                               String language)
Gets value of exo:activityId property in comment node base on provided path. If property is not existing then return null.

Parameters:
ownerPath - - the Path's Node what is owner created activity
commentId - - the id of comment posted for the question
language - - the language of comment
Returns:
String - the Id's activity created.
Since:
4.0


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.