|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.faq.service.impl.FAQServiceImpl
public class FAQServiceImpl
Created by The eXo Platform SARL Author : Hung Nguyen Quang hung.nguyen@exoplatform.com Mar 04, 2008
| Field Summary | |
|---|---|
static int |
CATEGORY
|
protected List<AnswerEventListener> |
listeners_
|
static int |
QUESTION
|
static int |
SEND_EMAIL
|
| Constructor Summary | |
|---|---|
FAQServiceImpl(org.exoplatform.container.xml.InitParams params,
org.exoplatform.forum.common.jcr.KSDataLocation locator,
org.exoplatform.container.configuration.ConfigurationManager configManager)
|
|
| Method Summary | |
|---|---|
void |
addInitialDataPlugin(InitialDataPlugin plugin)
Plugin to initialize default FAQ data |
void |
addLanguage(javax.jcr.Node questionNode,
QuestionLanguage language)
Adds the language node, when question have multiple language, each language is a child node of question node. |
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 |
addTemplatePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
|
void |
addWatch(String id,
Watch watch,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This function is used to allow user can watch a category. |
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 |
addWatchQuestion(String questionId,
Watch watch,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
calculateDeletedUser(String userName)
|
void |
changeStatusCategoryView(List<String> listCateIds)
This method should change view of category |
void |
changeStatusCategoryView(List<String> listCateIds,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
InputStream |
createAnswerRSS(String cateId)
Create RSS for answer |
void |
deleteAnswer(String questionId,
String answerId)
Remove an answer |
void |
deleteAnswer(String questionId,
String answerId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
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 |
deleteComment(String questionId,
String commentId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
deleteCommentQuestionLang(String questionPath,
String commentId,
String language)
Delete language in a comment |
void |
deleteMailInWatch(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String user)
This function will delete watch in one category |
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<Category> |
getAllCategories(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method get all the category |
List<String> |
getAllFAQAdmin()
This method get all admin in FAQ |
QuestionPageList |
getAllQuestions()
Get all questions |
QuestionPageList |
getAllQuestions(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method get all the question and convert to list of question object (QuestionPageList) |
QuestionPageList |
getAllQuestionsByCatetory(String categoryId,
FAQSetting faqSetting)
Get all questions of the category. |
QuestionPageList |
getAllQuestionsByCatetory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
This method get all questions via category identify and convert to list of question list |
Answer |
getAnswerById(String questionId,
String answerid)
Get answer of question |
Answer |
getAnswerById(String questionId,
String answerid,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
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 |
Category |
getCategoryById(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Returns an category that can then be get property of this category. |
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 |
long[] |
getCategoryInfo(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting setting)
This method get some informations of category: to count sub-categories, to count questions, to count question have not yet answer, to count question is not approved are contained in this category |
String |
getCategoryNameOf(String categoryPath)
Get name of category |
javax.jcr.Node |
getCategoryNodeById(String categoryId)
Get category node |
javax.jcr.Node |
getCategoryNodeById(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
List<String> |
getCategoryPath(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String categoryId)
This method return path of category identify |
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 questionPath)
Get path of question. |
String |
getCategoryPathOfQuestion(String questionPath,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
Comment |
getCommentById(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId,
String commentId)
|
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 |
QuestionPageList |
getListCategoriesWatch(String userId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
List<String> |
getListCateIdByModerator(String user)
Get all categories of user. |
List<String> |
getListCateIdByModerator(String user,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
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 |
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 |
QuestionPageList |
getListQuestionsWatch(FAQSetting faqSetting,
String currentUser,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
long |
getMaxindexCategory(String parentId)
Get max index of categories |
long |
getMaxindexCategory(String parentId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
org.exoplatform.forum.common.NotifyInfo |
getMessageInfo(String name)
Get informations about message |
String[] |
getModeratorsOf(String path)
Get moderators of question or category |
JCRPageList |
getPageListAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId,
boolean isSortByVote)
|
JCRPageList |
getPageListAnswer(String questionId,
boolean isSortByVote)
Get answers of question |
JCRPageList |
getPageListComment(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId)
|
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 function will send all the pending notification message |
QuestionPageList |
getPendingQuestionsByCategory(String categoryId,
FAQSetting faqSetting)
Get list pending questions in a category |
QuestionPageList |
getPendingQuestionsByCategory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
|
Question |
getQuestionById(String questionId)
Lookup the question node via identify, convert to question object and return |
Question |
getQuestionById(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method should get question node via identify |
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. |
List<QuestionLanguage> |
getQuestionLanguages(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method should lookup languageNode of question and find all child node of language node |
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 |
getQuestionsByCatetory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
This method should view questions, only question node is activated and approved via category identify and convert to list of question object |
QuestionPageList |
getQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer)
Get questions in list categories. |
QuestionPageList |
getQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method every category should get list question, all question convert to list of question object |
QuestionPageList |
getQuestionsNotYetAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String categoryId,
FAQSetting setting)
This method get all question node have not yet answer and convert to list of question object (QuestionPageList) |
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 will return list question when user input value search |
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 |
List<Category> |
getSubCategories(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting,
boolean isGetAll,
List<String> userView)
Returns an list category that can then be view on the screen. |
byte[] |
getTemplate()
Get template of questions |
FileAttachment |
getUserAvatar(String userName)
Get avatar of user |
FileAttachment |
getUserAvatar(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
getUserSetting(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userName,
FAQSetting faqSetting)
|
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 |
boolean |
getWatchByUser(String userId,
String cateId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
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 |
void |
importData(String categoryId,
javax.jcr.Session session,
InputStream inputStream,
boolean isZip,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
boolean |
isAdminRole(String userName)
Check permission of user |
boolean |
isAdminRole(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
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 |
moveCategory(String categoryId,
String destCategoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Move one category in list to another plate in project. |
void |
moveQuestions(List<String> questions,
String destCategoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This method should lookup questions via question identify and from category identify so lookup destination category and move questions to destination 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 absPathOfProp)
Save last active information of question |
void |
removeCategory(String categoryId)
This method should check exists of category and remove it |
void |
removeCategory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Remove one category in list |
void |
removeLanguage(String questionPath,
List<String> listLanguage)
Remove languages from question |
void |
removeQuestion(String questionId)
Delete question by question's id. |
void |
removeQuestion(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Remove one question in list |
void |
saveAnswer(String questionId,
Answer[] answers)
Save an answer |
void |
saveAnswer(String questionId,
Answer[] answers,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Deprecated. use saveAnswer(String questionId, Answer[] answers) |
void |
saveAnswer(String questionId,
Answer answer,
boolean isNew)
Save an answer |
void |
saveAnswer(String questionId,
Answer answer,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
saveAnswer(String questionPath,
Answer answer,
String language)
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 |
saveCategory(String parentId,
Category cat,
boolean isAddNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
Add new or edit category in list. |
void |
saveComment(String questionId,
Comment comment,
boolean isNew)
Save comment of question |
void |
saveComment(String questionId,
Comment comment,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
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. |
void |
saveFAQSetting(FAQSetting faqSetting,
String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
This function is used to set some properties of FAQ. |
javax.jcr.Node |
saveQuestion(Question question,
boolean isAddNew,
FAQSetting faqSetting)
Save question after create new question or edit infor of quesiton which is existed. |
javax.jcr.Node |
saveQuestion(Question question,
boolean isAddNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
This method should create new question or update exists question |
void |
saveTemplate(String str)
Save a template |
void |
saveTopicIdDiscussQuestion(String questionId,
String pathDiscuss)
Save topic |
void |
saveTopicIdDiscussQuestion(String questionId,
String pathDiscuss,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
saveUserAvatar(String userId,
FileAttachment fileAttachment)
Save avatar of an user |
void |
saveUserAvatar(String userId,
FileAttachment fileAttachment,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
setDefaultAvatar(String userName)
set default avatar for an user |
void |
setDefaultAvatar(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
start()
|
void |
stop()
|
void |
swapCategories(String cateId1,
String cateId2)
Swap two categories |
void |
swapCategories(String parentCateId,
String cateId1,
String cateId2,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
|
void |
unVoteQuestion(String questionPath,
String userName)
Remove vote for question |
void |
UnWatch(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userCurrent)
This function will un watch in one category |
void |
unWatchCategory(String categoryId,
String userCurrent)
This method will un watch in one category |
void |
UnWatchQuestion(String questionID,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userCurrent)
This function 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CATEGORY
public static final int QUESTION
public static final int SEND_EMAIL
protected List<AnswerEventListener> listeners_
| Constructor Detail |
|---|
public FAQServiceImpl(org.exoplatform.container.xml.InitParams params,
org.exoplatform.forum.common.jcr.KSDataLocation locator,
org.exoplatform.container.configuration.ConfigurationManager configManager)
throws Exception
Exception| Method Detail |
|---|
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
FAQService
addPlugin in interface FAQServiceplugin - the plugin
Exception - the exception
public void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
FAQService
addRolePlugin in interface FAQServiceplugin - the plugin
Exception - the exception
public void addInitialDataPlugin(InitialDataPlugin plugin)
throws Exception
FAQService
addInitialDataPlugin in interface FAQServiceException
public void addTemplatePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
Exceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startable
public List<String> getAllFAQAdmin()
throws Exception
getAllFAQAdmin in interface FAQServiceException - the exception
public List<Category> getAllCategories(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
sProvider - is session provider
Exception - the exception
public List<Category> getAllCategories()
throws Exception
FAQService
getAllCategories in interface FAQServiceException - the exception
public QuestionPageList getAllQuestions(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
sProvider -
Exception - the exception
public QuestionPageList getAllQuestions()
throws Exception
FAQService
getAllQuestions in interface FAQServiceException - if attachment not foune
public QuestionPageList getQuestionsNotYetAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String categoryId,
FAQSetting setting)
throws Exception
sProvider -
Exception - the exception
public QuestionPageList getQuestionsNotYetAnswer(String categoryId,
boolean isApproved)
throws Exception
FAQService
getQuestionsNotYetAnswer in interface FAQServiceException - if lost attachment
public long[] getCategoryInfo(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting setting)
throws Exception
categoryId - sProvider -
Exception - the exception
public long[] getCategoryInfo(String categoryId,
FAQSetting setting)
throws Exception
FAQService
getCategoryInfo in interface FAQServicecategoryId - the category id
Exception - if not found category by id
if not found question or lose file attach
public Category getCategoryById(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
categoryId - is address id of the category so you want getsProvider -
Exception - the exceptioncategory
public Category getCategoryById(String categoryId)
throws Exception
FAQService
getCategoryById in interface FAQServicecategoryId - is address id of the category so you want get
Exception - the exceptioncategory
public Question getQuestionById(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
question - identifysProvider -
Exception - the exception
public Comment[] getComments(String questionId)
throws Exception
FAQService
getComments in interface FAQServicequestionId - id of question
Exception
public Question getQuestionById(String questionId)
throws Exception
FAQService
getQuestionById in interface FAQServicequestionId - the question id
Exception - the exception
public QuestionPageList getQuestionsByCatetory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
throws Exception
Category - identifysProvider -
Exception - the exception
public QuestionPageList getQuestionsByCatetory(String categoryId,
FAQSetting faqSetting)
throws Exception
FAQServicecategoryId
then lookup questions of this category, only question is activated and approved
via category identify, the last convert to list of question object
getQuestionsByCatetory in interface FAQServicecategoryId - the category id
Exception - if can't found category
public QuestionPageList getAllQuestionsByCatetory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
throws Exception
Category - identifysProvider -
Exception - the exception
public QuestionPageList getAllQuestionsByCatetory(String categoryId,
FAQSetting faqSetting)
throws Exception
FAQServicecategoryId
then get all questions of this category and put them into an question page list object
getAllQuestionsByCatetory in interface FAQServicecategoryId - the id of category
Exception - when category not found
public QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
listCategoryId - is list via identifyisNotYetAnswer - if isNotYetAnswer equal true then return list question is not yet answer
isNotYetAnswer if isNotYetAnswer equal false then return list all questionssProvider -
Exception - the exception
public QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer)
throws Exception
FAQService
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
getQuestionsByListCatetory in interface FAQServicelistCategoryId - 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
public String getCategoryPathOfQuestion(String questionPath,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public String getCategoryPathOfQuestion(String questionPath)
throws Exception
FAQService
getCategoryPathOfQuestion in interface FAQServicequestionPath - id of category is contain question
Exception
public List<QuestionLanguage> getQuestionLanguages(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Question - identifysProvider -
Exception - the exceptionpublic List<QuestionLanguage> getQuestionLanguages(String questionId)
FAQService
getQuestionLanguages in interface FAQServicequestionId - the id of question
public List<Category> getSubCategories(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting,
boolean isGetAll,
List<String> userView)
throws Exception
This method always returns immediately, this view list category in screen. if categoryId equal null then list category is list parent category else this view list category of one value parent category that you communicate categoryId
categoryId - is address id of the categorysProvider -
Exception - the exceptioncategory
public List<Category> getSubCategories(String categoryId,
FAQSetting faqSetting,
boolean isGetAll,
List<String> userView)
throws Exception
FAQService
getSubCategories in interface FAQServicecategoryId - the category iduserView - the list of users to view categories.
Exception - the exception
public void moveQuestions(List<String> questions,
String destCategoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Question - identify listdestination - category identifysProvider -
Exception - the exception
public void moveQuestions(List<String> questions,
String destCategoryId,
String questionLink,
FAQSetting faqSetting)
throws Exception
FAQService
moveQuestions in interface FAQServicequestions - the questionsdestCategoryId - the dest category idquestionLink - the question linkfaqSetting - the FAQSetting
Exception - the exception
public void removeCategory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
This function is used to remove one category in list
categoryId - is address id of the category need removesProvider -
Exception - the exception
public void removeCategory(String categoryId)
throws Exception
FAQService
removeCategory in interface FAQServicecategoryId - is address id of the category need remove
Exception - the exception
public void removeQuestion(String questionId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
This function is used to remove one question in list
question - identifysProvider -
Exception - the exception
public void removeQuestion(String questionId)
throws Exception
FAQService
removeQuestion in interface FAQServicequestionId - the id of question is deleted
Exception - if question not found
public void saveCategory(String parentId,
Category cat,
boolean isAddNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
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 equal 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 categorysProvider -
Exception - the exceptioncategory
public void saveCategory(String parentId,
Category cat,
boolean isAddNew)
FAQServiceThis 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
saveCategory in interface FAQServiceparentId - 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
public void changeStatusCategoryView(List<String> listCateIds,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void changeStatusCategoryView(List<String> listCateIds)
throws Exception
FAQService
changeStatusCategoryView in interface FAQServicelistCateIds - is address ids of the category need to change
Exception - the exception
public javax.jcr.Node saveQuestion(Question question,
boolean isAddNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
throws Exception
question - is information but user input or edit to form interface of questionisAddNew - equal true then add new question
isAddNew equal false then update questionsProvider -
Exception
public javax.jcr.Node saveQuestion(Question question,
boolean isAddNew,
FAQSetting faqSetting)
throws Exception
FAQServiceisAddNew is true then create new question node
and set properties of question object to this node else reset infor for
this question node
saveQuestion in interface FAQServicequestion - the questionisAddNew - is true if create new question node
and is false if edit question node
Exception - if path of question nod not found
public void saveFAQSetting(FAQSetting faqSetting,
String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
This function is used(Users of FAQ Administrator) choose some properties in object FAQSetting
newSetting - is properties of object FAQSetting that user input to interface will save on datasProvider -
Exception - the exception
public void saveFAQSetting(FAQSetting faqSetting,
String userName)
throws Exception
FAQService
saveFAQSetting in interface FAQServiceException - the exception
public void moveCategory(String categoryId,
String destCategoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
This function is used to move category in list. User will right click on category need move, so user choose in list category one another category want to put
categoryId - is address id of the category that user want platedestCategoryId - is address id of the category that user want put( destination )sProvider -
Exception - the exceptionsee category this plate but user see that category at new plate
public void moveCategory(String categoryId,
String destCategoryId)
throws Exception
FAQService
moveCategory in interface FAQServicecategoryId - the category id should movedestCategoryId - : category is moved
Exception - the exception
public void addWatch(String id,
Watch watch,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
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 datasProvider -
Exception - the exception
public void addWatchCategory(String id,
Watch watch)
throws Exception
FAQService
addWatchCategory in interface FAQServiceid - of category with user want add watch on that category
Exception - the exception
public void deleteMailInWatch(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String user)
throws Exception
categoryId - is id of current categorysProvider - emails - is location current of one watch with user want delete
Exception - the exception
public void deleteCategoryWatch(String categoryId,
String user)
throws Exception
FAQService
deleteCategoryWatch in interface FAQServicecategoryId - is id of current category
Exception - the exception
public void UnWatch(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userCurrent)
throws Exception
categoryId - is id of current categorysProvider - emails - is location current of one watch with user want delete
Exception - the exception
public void unWatchCategory(String categoryId,
String userCurrent)
throws Exception
FAQService
unWatchCategory in interface FAQServicecategoryId - is id of current categoryuserCurrent - is user current then you un watch
Exception - the exception
public void UnWatchQuestion(String questionID,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userCurrent)
throws Exception
categoryId - is id of current categorysProvider - emails - is location current of one watch with user want delete
Exception - the exception
public void unWatchQuestion(String questionID,
String userCurrent)
throws Exception
FAQService
unWatchQuestion in interface FAQServiceuserCurrent - is user current then you un watch
Exception - the exception
public List<String> getListCateIdByModerator(String user,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
user - is name when user loginsProvider -
Exception - the exception
public List<String> getListCateIdByModerator(String user)
throws Exception
FAQServiceuser in moderators after that put this categories
into a list category object
getListCateIdByModerator in interface FAQServiceuser - the name of user
Exception - if can't found user
public List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
throws Exception
With many questions , it's difficult to find a question which user want to see. So to support to users can find their questions more quickly and accurate, user can use 'Search Question' function
getSearchResults in interface FAQServicesProvider - eventQuery - is object save value in form advanced search
Exception - the exception
public List<String> getCategoryPath(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String categoryId)
throws Exception
category - identifysProvider -
Exception - the exception
public List<String> getCategoryPath(String categoryId)
throws Exception
FAQService
getCategoryPath in interface FAQServiceException - the exceptionpublic Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
getPendingMessages in interface FAQService
public void addLanguage(javax.jcr.Node questionNode,
QuestionLanguage language)
throws Exception
addLanguage in interface FAQServicequestionNode - the question node which have multiple languagelanguage - the language which is added in to questionNode
Exception - throw an exception when save a new language node
public void getUserSetting(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String userName,
FAQSetting faqSetting)
throws Exception
Exception
public void getUserSetting(String userName,
FAQSetting faqSetting)
throws Exception
FAQService
getUserSetting in interface FAQServiceuserName - the name of userfaqSetting - the setting of user
Exception - when can't find user or faqSetting
public org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
throws Exception
FAQService
getMessageInfo in interface FAQServicename - key of message
Exception
public boolean isAdminRole(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public boolean isAdminRole(String userName)
throws Exception
FAQService
isAdminRole in interface FAQServiceuserName - 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
public javax.jcr.Node getCategoryNodeById(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public javax.jcr.Node getCategoryNodeById(String categoryId)
throws Exception
FAQService
getCategoryNodeById in interface FAQServicecategoryId - id of category
Exception
public void addWatchQuestion(String questionId,
Watch watch,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void addWatchQuestion(String questionId,
Watch watch,
boolean isNew)
throws Exception
FAQService
addWatchQuestion in interface FAQServicequestionId - id of questionwatch - contains information of usersisNew - add new or edit
Exception
public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
String currentUser,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
String currentUser)
throws Exception
FAQService
getListQuestionsWatch in interface FAQServicefaqSetting - setting of usercurrentUser - username
Exception
public void importData(String categoryId,
javax.jcr.Session session,
InputStream inputStream,
boolean isZip,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public boolean importData(String categoryId,
InputStream inputStream,
boolean isZip)
throws Exception
FAQService
importData in interface FAQServiceException
public InputStream exportData(String categoryId,
boolean createZipFile)
throws Exception
FAQService
exportData in interface FAQServicecategoryId - id of categorycreateZipFile - create zip file or not
Exception
public void swapCategories(String parentCateId,
String cateId1,
String cateId2,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void swapCategories(String cateId1,
String cateId2)
throws Exception
FAQService
swapCategories in interface FAQServicecateId1 - id of category 1cateId2 - id of category 2
Exception
public void saveTopicIdDiscussQuestion(String questionId,
String pathDiscuss,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void saveTopicIdDiscussQuestion(String questionId,
String pathDiscuss)
throws Exception
FAQService
saveTopicIdDiscussQuestion in interface FAQServicequestionId - Question to discusspathDiscuss - path to discussion
Exception
public long getMaxindexCategory(String parentId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public long getMaxindexCategory(String parentId)
throws Exception
FAQService
getMaxindexCategory in interface FAQServiceparentId - id of parent
Exception
public void deleteAnswer(String questionId,
String answerId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void deleteAnswer(String questionId,
String answerId)
throws Exception
FAQService
deleteAnswer in interface FAQServicequestionId - id of questionanswerId - id of answer
Exception
public void deleteComment(String questionId,
String commentId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void deleteComment(String questionId,
String commentId)
throws Exception
FAQService
deleteComment in interface FAQServicequestionId - id of questioncommentId - id of comment
Exception
public void saveAnswer(String questionId,
Answer answer,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void saveAnswer(String questionId,
Answer answer,
boolean isNew)
throws Exception
FAQService
saveAnswer in interface FAQServicequestionId - id of questionanswer - saved answerisNew - save new or edit
Exception
public void saveComment(String questionId,
Comment comment,
boolean isNew,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void saveComment(String questionId,
Comment comment,
boolean isNew)
throws Exception
FAQService
saveComment in interface FAQServicequestionId - id of questioncomment - saved commentisNew - save new or edit
Exception
public Comment getCommentById(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId,
String commentId)
throws Exception
Exception
public Comment getCommentById(String questionId,
String commentId)
throws Exception
FAQService
getCommentById in interface FAQServicequestionId - id of questioncommentId - id of comment
Exception
public Answer getAnswerById(String questionId,
String answerid,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public Answer getAnswerById(String questionId,
String answerid)
throws Exception
FAQService
getAnswerById in interface FAQServicequestionId - id of questionanswerid - id of answer
Exception
public void saveAnswer(String questionId,
Answer[] answers,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
saveAnswer(String questionId, Answer[] answers)
Exception
public void saveAnswer(String questionId,
Answer[] answers)
throws Exception
FAQService
saveAnswer in interface FAQServicequestionId - id of questionanswers - saved answers
Exception
public JCRPageList getPageListAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId,
boolean isSortByVote)
throws Exception
Exception
public JCRPageList getPageListAnswer(String questionId,
boolean isSortByVote)
throws Exception
FAQService
getPageListAnswer in interface FAQServicequestionId - id of questionisSortByVote - sort by vote
Exception
public JCRPageList getPageListComment(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
String questionId)
throws Exception
Exception
public JCRPageList getPageListComment(String questionId)
throws Exception
FAQService
getPageListComment in interface FAQServicequestionId - id of question
Exception
public QuestionPageList getListCategoriesWatch(String userId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public QuestionPageList getWatchedCategoryByUser(String userId)
throws Exception
FAQService
getWatchedCategoryByUser in interface FAQServiceuserId - username
Exception
public FileAttachment getUserAvatar(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public FileAttachment getUserAvatar(String userName)
throws Exception
FAQService
getUserAvatar in interface FAQServiceuserName - username
Exception
public void saveUserAvatar(String userId,
FileAttachment fileAttachment,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void saveUserAvatar(String userId,
FileAttachment fileAttachment)
throws Exception
FAQService
saveUserAvatar in interface FAQServiceuserId - usernamefileAttachment - avatar of user
Exception
public void setDefaultAvatar(String userName,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public void setDefaultAvatar(String userName)
throws Exception
FAQService
setDefaultAvatar in interface FAQServiceuserName - username
Exception
public boolean getWatchByUser(String userId,
String cateId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exception
public boolean isUserWatched(String userId,
String cateId)
FAQService
isUserWatched in interface FAQServiceuserId - usernamecateId - id of category
public QuestionPageList getPendingQuestionsByCategory(String categoryId,
org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
FAQSetting faqSetting)
throws Exception
Exception
public QuestionPageList getPendingQuestionsByCategory(String categoryId,
FAQSetting faqSetting)
throws Exception
FAQService
getPendingQuestionsByCategory in interface FAQServicecategoryId - id of categoryfaqSetting - settings
Exception
public boolean isExisting(String path)
throws Exception
FAQService
isExisting in interface FAQServicepath - path need check
Exception
public String getCategoryPathOf(String id)
throws Exception
FAQService
getCategoryPathOf in interface FAQServiceid - category id
Exception
public List<String> getQuestionContents(List<String> paths)
throws Exception
FAQService
getQuestionContents in interface FAQServicepaths - path of questions
Exception
public Map<String,String> getRelationQuestion(List<String> paths)
throws Exception
FAQService
getRelationQuestion in interface FAQServicepaths - path of questions
Exception
public javax.jcr.Node getQuestionNodeById(String path)
throws Exception
FAQService
getQuestionNodeById in interface FAQServicepath - id of question
Exception
public boolean isModerateAnswer(String id)
throws Exception
FAQService
isModerateAnswer in interface FAQServiceid - id of category
Exception
public boolean isModerateQuestion(String id)
throws Exception
FAQService
isModerateQuestion in interface FAQServiceid - id of question
Exception
public String getParentCategoriesName(String path)
throws Exception
FAQService
getParentCategoriesName in interface FAQServicepath - id of category
Exception
public QuestionPageList getListMailInWatch(String categoryId)
throws Exception
FAQService
getListMailInWatch in interface FAQServicecategoryId - id of category
Exception
public boolean isCategoryModerator(String categoryId,
String user)
throws Exception
FAQService
isCategoryModerator in interface FAQServicecategoryId - id of categoryuser - username
Exception
public void addLanguage(String questionPath,
QuestionLanguage language)
throws Exception
FAQService
addLanguage in interface FAQServicequestionPath - patch of questionlanguage - question language
Exception
public void deleteAnswerQuestionLang(String questionPath,
String answerId,
String language)
throws Exception
FAQService
deleteAnswerQuestionLang in interface FAQServicequestionPath - path of questionanswerId - id of answerlanguage - deleted language
Exception
public void deleteCommentQuestionLang(String questionPath,
String commentId,
String language)
throws Exception
FAQService
deleteCommentQuestionLang in interface FAQServicequestionPath - path of questioncommentId - id of commentlanguage - deleted language
Exception
public QuestionLanguage getQuestionLanguageByLanguage(String questionPath,
String language)
throws Exception
FAQService
getQuestionLanguageByLanguage in interface FAQServicequestionPath - path of questionlanguage - got language
Exception
public Comment getCommentById(String questionPath,
String commentId,
String language)
throws Exception
FAQService
getCommentById in interface FAQServicequestionPath - path of questioncommentId - id of comment
Exception
public Answer getAnswerById(String questionPath,
String answerid,
String language)
throws Exception
FAQService
getAnswerById in interface FAQServicequestionPath - path of questionanswerid - id of answer
Exception
public void saveAnswer(String questionPath,
Answer answer,
String language)
throws Exception
FAQService
saveAnswer in interface FAQServicequestionPath - path of questionanswer - object answer want to savelanguage - language of answer
Exception
public void saveAnswer(String questionPath,
QuestionLanguage questionLanguage)
throws Exception
FAQService
saveAnswer in interface FAQServicequestionPath - path of questionquestionLanguage - language of answer
Exception
public void saveComment(String questionPath,
Comment comment,
String languge)
throws Exception
FAQService
saveComment in interface FAQServicequestionPath - path of questioncomment - comment want to savelanguge - language of comment
Exception
public void removeLanguage(String questionPath,
List<String> listLanguage)
FAQService
removeLanguage in interface FAQServicequestionPath - path of questionlistLanguage - removed languages
public void voteAnswer(String answerPath,
String userName,
boolean isUp)
throws Exception
FAQService
voteAnswer in interface FAQServiceanswerPath - path of answeruserName - username of user vote for answerisUp - up or not
Exception
public void voteQuestion(String questionPath,
String userName,
int number)
throws Exception
FAQService
voteQuestion in interface FAQServicequestionPath - path of questionuserName - username of user vote for questionnumber - value user vote
Exception
public void unVoteQuestion(String questionPath,
String userName)
throws Exception
FAQService
unVoteQuestion in interface FAQServicequestionPath - path of questionuserName - username remove vote
Exception
public String[] getModeratorsOf(String path)
throws Exception
FAQService
getModeratorsOf in interface FAQServicepath - path of question or category
Exceptionpublic boolean isViewAuthorInfo(String id)
FAQService
isViewAuthorInfo in interface FAQServiceid - id of question
public long existingCategories()
throws Exception
FAQService
existingCategories in interface FAQServiceException
public String getCategoryNameOf(String categoryPath)
throws Exception
FAQService
getCategoryNameOf in interface FAQServicecategoryPath - path of category
Exception
public List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId,
boolean isNotYetAnswer)
throws Exception
FAQService
getQuickQuestionsByListCatetory in interface FAQServicelistCategoryId - id of some categoriesisNotYetAnswer - is answer or not
Exception
public List<Cate> listingCategoryTree()
throws Exception
FAQService
listingCategoryTree in interface FAQServiceException
public List<Watch> getWatchByCategory(String categoryId)
throws Exception
FAQService
getWatchByCategory in interface FAQServicecategoryId - id of category
Exceptionpublic boolean hasWatch(String categoryPath)
FAQService
hasWatch in interface FAQServicecategoryPath - path of category
public CategoryInfo getCategoryInfo(String categoryPath,
List<String> categoryIdScoped)
throws Exception
FAQService
getCategoryInfo in interface FAQServicecategoryPath - path of categorycategoryIdScoped - list sub of category
Exception
public byte[] getTemplate()
throws Exception
FAQService
getTemplate in interface FAQServiceException
public void saveTemplate(String str)
throws Exception
FAQService
saveTemplate in interface FAQServicestr - template
Exception
public boolean isCategoryExist(String name,
String path)
FAQService
isCategoryExist in interface FAQServicename - name of categorypath - path of category
public void updateQuestionRelatives(String questionPath,
String[] relatives)
throws Exception
FAQService
updateQuestionRelatives in interface FAQServicequestionPath - path of questionrelatives - input relatives
Exception
public InputStream createAnswerRSS(String cateId)
throws Exception
FAQService
createAnswerRSS in interface FAQServicecateId - id of category
Exception
public void reCalculateLastActivityOfQuestion(String absPathOfProp)
throws Exception
FAQService
reCalculateLastActivityOfQuestion in interface FAQServiceabsPathOfProp - path of question
Exception
public void addListenerPlugin(AnswerEventListener listener)
throws Exception
FAQService
addListenerPlugin in interface FAQServicelistener - answer event listener
Exception
public void calculateDeletedUser(String userName)
throws Exception
calculateDeletedUser in interface FAQServiceException
public Object readCategoryProperty(String categoryId,
String propertyName,
Class returnType)
throws Exception
FAQService
readCategoryProperty in interface FAQServicecategoryId - id of the categorypropertyName - name of the propertyreturnType - expected return-type. The supported class are String[], String, Long, Boolean, Double and Date .
Exception
public Object readQuestionProperty(String questionId,
String propertyName,
Class returnType)
throws Exception
FAQService
readQuestionProperty in interface FAQServicequestionId - 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 | |||||||||