|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FAQService
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.
| 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 |
|---|
void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
plugin - the plugin
Exception - the exception
void addInitialDataPlugin(InitialDataPlugin plugin)
throws Exception
plugin -
Exception
void saveCategory(String parentId,
Category cat,
boolean isAddNew)
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
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 categorycat - is properties that user input to interface will save on dataisAddNew - is true when add new category else update categorycategory
void changeStatusCategoryView(List<String> listCateIds)
throws Exception
listCateIds - is address ids of the category need to change
Exception - the exception
void removeCategory(String categoryId)
throws Exception
categoryId - is address id of the category need remove
Exception - the exception
Category getCategoryById(String categoryId)
throws Exception
categoryId - is address id of the category so you want get
Exception - the exceptioncategory
List<Category> getAllCategories()
throws Exception
Exception - the exception
List<String> getListCateIdByModerator(String user)
throws Exception
user in moderators after that put this categories
into a list category object
user - the name of user
Exception - if can't found user
List<Category> getSubCategories(String categoryId,
FAQSetting faqSetting,
boolean isGetAll,
List<String> userView)
throws Exception
categoryId - the category iduserView - the list of users to view categories.
Exception - the exception
void moveCategory(String categoryId,
String destCategoryId)
throws Exception
categoryId - the category id should movedestCategoryId - : category is moved
Exception - the exception
javax.jcr.Node saveQuestion(Question question,
boolean isAddNew,
FAQSetting faqSetting)
throws Exception
isAddNew is true then create new question node
and set properties of question object to this node else reset infor for
this question node
question - the questionisAddNew - is true if create new question node
and is false if edit question node
Exception - if path of question nod not found
void removeQuestion(String questionId)
throws Exception
questionId - the id of question is deleted
Exception - if question not found
Question getQuestionById(String questionId)
throws Exception
questionId - the question id
Exception - the exception
QuestionPageList getAllQuestions()
throws Exception
Exception - if attachment not foune
QuestionPageList getQuestionsNotYetAnswer(String categoryId,
boolean isApproved)
throws Exception
Exception - if lost attachment
QuestionPageList getQuestionsByCatetory(String categoryId,
FAQSetting faqSetting)
throws Exception
categoryId
then lookup questions of this category, only question is activated and approved
via category identify, the last convert to list of question object
categoryId - the category id
Exception - if can't found category
QuestionPageList getAllQuestionsByCatetory(String categoryId,
FAQSetting faqSetting)
throws Exception
categoryId
then get all questions of this category and put them into an question page list object
categoryId - the id of category
Exception - when category not found
long[] getCategoryInfo(String categoryId,
FAQSetting setting)
throws Exception
categoryId - the category id
Exception - if not found category by id
if not found question or lose file attach
Exception - the exception
QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer)
throws Exception
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
listCategoryId - the list category idisNotYetAnswer - is true if get qeustions not yet answered
is false if want get all questions in list categories
Exception - the exception
String getCategoryPathOfQuestion(String categoryId)
throws Exception
categoryId - id of category is contain question
ExceptionList<QuestionLanguage> getQuestionLanguages(String questionId)
questionId - the id of question
void moveQuestions(List<String> questions,
String destCategoryId,
String questionLink,
FAQSetting faqSetting)
throws Exception
questions - the questionsdestCategoryId - the dest category idquestionLink - the question linkfaqSetting - the FAQSetting
Exception - the exception
void saveFAQSetting(FAQSetting faqSetting,
String userName)
throws Exception
newSetting - the new setting
Exception - the exception
void addWatchCategory(String id,
Watch watch)
throws Exception
id - of category with user want add watch on that categoryvalue, - this address email (multiple value) with input to interface will save on data
Exception - the exception
void deleteCategoryWatch(String categoryId,
String user)
throws Exception
categoryId - is id of current categoryemails - is location current of one watch with user want delete
Exception - the exception
void unWatchCategory(String categoryId,
String userCurrent)
throws Exception
categoryId - is id of current categoryuserCurrent - is user current then you un watch
Exception - the exception
void unWatchQuestion(String questionID,
String userCurrent)
throws Exception
questionId - is id of current categoryuserCurrent - is user current then you un watch
Exception - the exception
List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
throws Exception
user - is name when user login
Exception - the exception
List<String> getCategoryPath(String categoryId)
throws Exception
category - identify
Exception - the exceptionIterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
void addLanguage(javax.jcr.Node questionNode,
QuestionLanguage language)
throws Exception
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.
questionNode - add language node for this question nodelanguage - 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
Exception - the exception
void getUserSetting(String userName,
FAQSetting faqSetting)
throws Exception
userName - the name of userfaqSetting - the setting of user
Exception - when can't find user or faqSetting
org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
throws Exception
name - key of message
Exception
boolean isAdminRole(String userName)
throws Exception
userName - id or user name of user who is checked permission
true if user is admin. The current user is implied if userName is null.
Exception
List<String> getAllFAQAdmin()
throws Exception
Exception - the exception
void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
plugin - the plugin
Exception - the exception
void addWatchQuestion(String questionId,
Watch watch,
boolean isNew)
throws Exception
questionId - id of questionwatch - contains information of usersisNew - add new or edit
Exception
void saveTopicIdDiscussQuestion(String questionId,
String pathDiscuss)
throws Exception
questionId - Question to discusspathDiscuss - path to discussion
Exception
QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
String currentUser)
throws Exception
faqSetting - setting of usercurrentUser - username
Exception
javax.jcr.Node getCategoryNodeById(String categoryId)
throws Exception
categoryId - id of category
Exception
boolean importData(String categoryId,
InputStream inputStream,
boolean isZip)
throws Exception
name - key of message
Exception
void swapCategories(String cateId1,
String cateId2)
throws Exception
cateId1 - id of category 1cateId2 - id of category 2
Exception
long getMaxindexCategory(String parentId)
throws Exception
parentId - id of parent
Exception
void deleteAnswer(String questionId,
String answerId)
throws Exception
questionId - id of questionanswerId - id of answer
Exception
void deleteComment(String questionId,
String commentId)
throws Exception
questionId - id of questioncommentId - id of comment
Exception
void saveAnswer(String questionId,
Answer answer,
boolean isNew)
throws Exception
questionId - id of questionanswer - saved answerisNew - save new or edit
Exception
void saveComment(String questionId,
Comment comment,
boolean isNew)
throws Exception
questionId - id of questioncomment - saved commentisNew - save new or edit
Exception
Comment getCommentById(String questionId,
String commentId)
throws Exception
questionId - id of questioncommentId - id of comment
Exception
Answer getAnswerById(String questionId,
String answerid)
throws Exception
questionId - id of questionanswerid - id of answer
Exception
void saveAnswer(String questionId,
Answer[] answers)
throws Exception
questionId - id of questionanswers - saved answers
Exception
JCRPageList getPageListComment(String questionId)
throws Exception
questionId - id of question
Exception
JCRPageList getPageListAnswer(String questionId,
boolean isSortByVote)
throws Exception
questionId - id of questionisSortByVote - sort by vote
Exception
QuestionPageList getWatchedCategoryByUser(String userId)
throws Exception
userId - username
Exception
FileAttachment getUserAvatar(String userName)
throws Exception
userName - username
Exception
void saveUserAvatar(String userId,
FileAttachment fileAttachment)
throws Exception
userId - usernamefileAttachment - avatar of user
Exception
boolean isUserWatched(String userId,
String cateId)
userId - usernamecateId - id of category
Exception
void setDefaultAvatar(String userName)
throws Exception
userName - username
Exception
QuestionPageList getPendingQuestionsByCategory(String categoryId,
FAQSetting faqSetting)
throws Exception
categoryId - id of categoryfaqSetting - settings
Exception
InputStream exportData(String categoryId,
boolean createZipFile)
throws Exception
categoryId - id of categorycreateZipFile - create zip file or not
Exception
boolean isExisting(String path)
throws Exception
path - path need check
Exception
String getCategoryPathOf(String id)
throws Exception
id - category id
Exception
Map<String,String> getRelationQuestion(List<String> paths)
throws Exception
paths - path of questions
Exception
List<String> getQuestionContents(List<String> paths)
throws Exception
paths - path of questions
Exception
boolean isModerateAnswer(String id)
throws Exception
id - id of category
Exception
javax.jcr.Node getQuestionNodeById(String path)
throws Exception
path - id of question
Exception
String getParentCategoriesName(String path)
throws Exception
path - id of category
Exception
QuestionPageList getListMailInWatch(String categoryId)
throws Exception
categoryId - id of category
Exception
boolean isCategoryModerator(String categoryId,
String user)
throws Exception
categoryId - id of categoryuser - username
Exception
void addLanguage(String questionPath,
QuestionLanguage language)
throws Exception
questionPath - patch of questionlanguage - question language
Exception
void deleteAnswerQuestionLang(String questionPath,
String answerId,
String language)
throws Exception
questionPath - path of questionanswerId - id of answerlanguage - deleted language
Exception
void deleteCommentQuestionLang(String questionPath,
String commentId,
String language)
throws Exception
questionPath - path of questioncommentId - id of commentlanguage - deleted language
Exception
QuestionLanguage getQuestionLanguageByLanguage(String questionPath,
String language)
throws Exception
questionPath - path of questionlanguage - got language
Exception
Comment getCommentById(String questionPath,
String commentId,
String language)
throws Exception
questionPath - path of questioncommentId - id of commentlanguage -
Exception
Answer getAnswerById(String questionPath,
String answerid,
String language)
throws Exception
questionPath - path of questionanswerid - id of answerlanguage -
Exception
void saveAnswer(String questionPath,
Answer answer,
String languge)
throws Exception
questionPath - path of questionanswer - object answer want to savelanguge - language of answer
Exception
void saveAnswer(String questionPath,
QuestionLanguage questionLanguage)
throws Exception
questionPath - path of questionquestionLanguage - language of answer
Exception
void saveComment(String questionPath,
Comment comment,
String languge)
throws Exception
questionPath - path of questioncomment - comment want to savelanguge - language of comment
Exception
void removeLanguage(String questionPath,
List<String> listLanguage)
questionPath - path of questionlistLanguage - removed languages
Exception
void voteAnswer(String answerPath,
String userName,
boolean isUp)
throws Exception
answerPath - path of answeruserName - username of user vote for answerisUp - up or not
Exception
void voteQuestion(String questionPath,
String userName,
int number)
throws Exception
questionPath - path of questionuserName - username of user vote for questionnumber - value user vote
Exception
String[] getModeratorsOf(String path)
throws Exception
path - path of question or category
Exception
void unVoteQuestion(String questionPath,
String userName)
throws Exception
questionPath - path of questionuserName - username remove vote
Exceptionboolean isViewAuthorInfo(String id)
id - id of question
long existingCategories()
throws Exception
Exception
String getCategoryNameOf(String categoryPath)
throws Exception
categoryPath - path of category
Exception
List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer)
throws Exception
listCategoryId - id of some categoriesisNotYetAnswer - is answer or not
Exception
List<Cate> listingCategoryTree()
throws Exception
Exception
List<Watch> getWatchByCategory(String categoryId)
throws Exception
categoryId - id of category
Exceptionboolean hasWatch(String categoryPath)
categoryPath - path of category
Exception
CategoryInfo getCategoryInfo(String categoryPath,
List<String> categoryIdScoped)
throws Exception
categoryPath - path of categorycategoryIdScoped - list sub of category
Exception
byte[] getTemplate()
throws Exception
Exception
void saveTemplate(String str)
throws Exception
str - template
Exception
boolean isCategoryExist(String name,
String path)
name - name of categorypath - path of category
Exception
void updateQuestionRelatives(String questionPath,
String[] relatives)
throws Exception
questionPath - path of questionrelatives - input relatives
Exception
boolean isModerateQuestion(String id)
throws Exception
id - id of question
Exception
InputStream createAnswerRSS(String cateId)
throws Exception
cateId - id of category
Exception
void reCalculateLastActivityOfQuestion(String absPathOfItem)
throws Exception
absPathOfItem - path of question
Exception
void addListenerPlugin(AnswerEventListener listener)
throws Exception
listener - answer event listener
Exception
Comment[] getComments(String questionId)
throws Exception
questionId - id of question
Exception
void calculateDeletedUser(String userName)
throws Exception
Exception
Object readCategoryProperty(String categoryId,
String propertyName,
Class returnType)
throws Exception
categoryId - id of the categorypropertyName - name of the propertyreturnType - expected return-type. The supported class are String[], String, Long, Boolean, Double and Date .
Exception
Object readQuestionProperty(String questionId,
String propertyName,
Class returnType)
throws Exception
questionId - id of the questionpropertyName - name of the propertyreturnType - expected return-type. The supported class are String[], String, Long, Boolean, Double and Date.
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||