org.exoplatform.faq.service.impl
Class FAQServiceImpl

java.lang.Object
  extended by org.exoplatform.faq.service.impl.FAQServiceImpl
All Implemented Interfaces:
FAQService, FAQServiceLegacy, org.picocontainer.Startable

public class FAQServiceImpl
extends Object
implements FAQService, org.picocontainer.Startable

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

CATEGORY

public static final int CATEGORY
See Also:
Constant Field Values

QUESTION

public static final int QUESTION
See Also:
Constant Field Values

SEND_EMAIL

public static final int SEND_EMAIL
See Also:
Constant Field Values

listeners_

protected List<AnswerEventListener> listeners_
Constructor Detail

FAQServiceImpl

public FAQServiceImpl(org.exoplatform.container.xml.InitParams params,
                      org.exoplatform.forum.common.jcr.KSDataLocation locator,
                      org.exoplatform.container.configuration.ConfigurationManager configManager)
               throws Exception
Throws:
Exception
Method Detail

addPlugin

public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
               throws Exception
Description copied from interface: FAQService
Adds the plugin.

Specified by:
addPlugin in interface FAQService
Parameters:
plugin - the plugin
Throws:
Exception - the exception

addRolePlugin

public void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                   throws Exception
Description copied from interface: FAQService
Adds the plugin.

Specified by:
addRolePlugin in interface FAQService
Parameters:
plugin - the plugin
Throws:
Exception - the exception

addInitialDataPlugin

public void addInitialDataPlugin(InitialDataPlugin plugin)
                          throws Exception
Description copied from interface: FAQService
Plugin to initialize default FAQ data

Specified by:
addInitialDataPlugin in interface FAQService
Throws:
Exception

addTemplatePlugin

public void addTemplatePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                       throws Exception
Throws:
Exception

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

getAllFAQAdmin

public List<String> getAllFAQAdmin()
                            throws Exception
This method get all admin in FAQ

Specified by:
getAllFAQAdmin in interface FAQService
Returns:
userName list
Throws:
Exception - the exception

getAllCategories

public List<Category> getAllCategories(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                throws Exception
This method get all the category

Parameters:
sProvider - is session provider
Returns:
Category list
Throws:
Exception - the exception

getAllCategories

public List<Category> getAllCategories()
                                throws Exception
Description copied from interface: FAQService
This method should lookup all the category and convert to category object and return list of category object

Specified by:
getAllCategories in interface FAQService
Returns:
Category list
Throws:
Exception - the exception

getAllQuestions

public QuestionPageList getAllQuestions(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                 throws Exception
This method get all the question and convert to list of question object (QuestionPageList)

Parameters:
sProvider -
Returns:
QuestionPageList
Throws:
Exception - the exception

getAllQuestions

public QuestionPageList getAllQuestions()
                                 throws Exception
Description copied from interface: FAQService
Get all questions

Specified by:
getAllQuestions in interface FAQService
Returns:
List of question
Throws:
Exception - if attachment not foune

getQuestionsNotYetAnswer

public QuestionPageList getQuestionsNotYetAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                 String categoryId,
                                                 FAQSetting setting)
                                          throws Exception
This method get all question node have not yet answer and convert to list of question object (QuestionPageList)

Parameters:
sProvider -
Returns:
QuestionPageList
Throws:
Exception - the exception

getQuestionsNotYetAnswer

public QuestionPageList getQuestionsNotYetAnswer(String categoryId,
                                                 boolean isApproved)
                                          throws Exception
Description copied from interface: FAQService
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

Specified by:
getQuestionsNotYetAnswer in interface FAQService
Returns:
List of question
Throws:
Exception - if lost attachment

getCategoryInfo

public long[] getCategoryInfo(String categoryId,
                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                              FAQSetting setting)
                       throws Exception
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

Parameters:
categoryId -
sProvider -
Returns:
number of (sub-categories, questions, questions is not approved,question is have not yet answered)
Throws:
Exception - the exception

getCategoryInfo

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

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

getCategoryById

public Category getCategoryById(String categoryId,
                                org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                         throws Exception
Returns an category that can then be get property of this category.

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

getCategoryById

public Category getCategoryById(String categoryId)
                         throws Exception
Description copied from interface: FAQService
This method should lookup category via identify and convert to Category object and return

Specified by:
getCategoryById in interface FAQService
Parameters:
categoryId - is address id of the category so you want get
Returns:
category is id = categoryId
Throws:
Exception - the exception
See Also:
category

getQuestionById

public Question getQuestionById(String questionId,
                                org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                         throws Exception
This method should get question node via identify

Parameters:
question - identify
sProvider -
Returns:
Question
Throws:
Exception - the exception

getComments

public Comment[] getComments(String questionId)
                      throws Exception
Description copied from interface: FAQService
Get comments of a question

Specified by:
getComments in interface FAQService
Parameters:
questionId - id of question
Returns:
comments of question
Throws:
Exception

getQuestionById

public Question getQuestionById(String questionId)
                         throws Exception
Description copied from interface: FAQService
Lookup the question node via identify, convert to question object and return

Specified by:
getQuestionById in interface FAQService
Parameters:
questionId - the question id
Returns:
Question
Throws:
Exception - the exception

getQuestionsByCatetory

public QuestionPageList getQuestionsByCatetory(String categoryId,
                                               org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                               FAQSetting faqSetting)
                                        throws Exception
This method should view questions, only question node is activated and approved via category identify and convert to list of question object

Parameters:
Category - identify
sProvider -
Returns:
QuestionPageList
Throws:
Exception - the exception

getQuestionsByCatetory

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

Specified by:
getQuestionsByCatetory in interface FAQService
Parameters:
categoryId - the category id
Returns:
Question list
Throws:
Exception - if can't found category

getAllQuestionsByCatetory

public QuestionPageList getAllQuestionsByCatetory(String categoryId,
                                                  org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                  FAQSetting faqSetting)
                                           throws Exception
This method get all questions via category identify and convert to list of question list

Parameters:
Category - identify
sProvider -
Returns:
QuestionPageList
Throws:
Exception - the exception

getAllQuestionsByCatetory

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

Specified by:
getAllQuestionsByCatetory in interface FAQService
Parameters:
categoryId - the id of category
Returns:
Question page list
Throws:
Exception - when category not found

getQuestionsByListCatetory

public QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
                                                   boolean isNotYetAnswer,
                                                   org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                            throws Exception
This method every category should get list question, all question convert to list of question object

Parameters:
listCategoryId - is list via identify
isNotYetAnswer - if isNotYetAnswer equal true then return list question is not yet answer isNotYetAnswer if isNotYetAnswer equal false then return list all questions
sProvider -
Returns:
QuestionPageList
Throws:
Exception - the exception

getQuestionsByListCatetory

public QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
                                                   boolean isNotYetAnswer)
                                            throws Exception
Description copied from interface: FAQService
Get questions in list categories.

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

Specified by:
getQuestionsByListCatetory in interface FAQService
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

public String getCategoryPathOfQuestion(String questionPath,
                                        org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                 throws Exception
Throws:
Exception

getCategoryPathOfQuestion

public String getCategoryPathOfQuestion(String questionPath)
                                 throws Exception
Description copied from interface: FAQService
Get path of question. For example question A is included in category C and C is child of category B, then, this function will be return C > B

Specified by:
getCategoryPathOfQuestion in interface FAQService
Parameters:
questionPath - id of category is contain question
Returns:
name of categories
Throws:
Exception

getQuestionLanguages

public List<QuestionLanguage> getQuestionLanguages(String questionId,
                                                   org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                            throws Exception
This method should lookup languageNode of question and find all child node of language node

Parameters:
Question - identify
sProvider -
Returns:
language list
Throws:
Exception - the exception

getQuestionLanguages

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

Specified by:
getQuestionLanguages in interface FAQService
Parameters:
questionId - the id of question
Returns:
list languages are support by the question

getSubCategories

public List<Category> getSubCategories(String categoryId,
                                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                       FAQSetting faqSetting,
                                       boolean isGetAll,
                                       List<String> userView)
                                throws Exception
Returns an list category that can then be view on the screen.

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

Parameters:
categoryId - is address id of the category
sProvider -
Returns:
List parent category or list sub category
Throws:
Exception - the exception
See Also:
category

getSubCategories

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

Specified by:
getSubCategories in interface FAQService
Parameters:
categoryId - the category id
userView - the list of users to view categories.
Returns:
Category list
Throws:
Exception - the exception

moveQuestions

public void moveQuestions(List<String> questions,
                          String destCategoryId,
                          org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                   throws Exception
This method should lookup questions via question identify and from category identify so lookup destination category and move questions to destination category

Parameters:
Question - identify list
destination - category identify
sProvider -
Throws:
Exception - the exception

moveQuestions

public void moveQuestions(List<String> questions,
                          String destCategoryId,
                          String questionLink,
                          FAQSetting faqSetting)
                   throws Exception
Description copied from interface: FAQService
Move all of questions to category which have id is specified

Specified by:
moveQuestions in interface FAQService
Parameters:
questions - the questions
destCategoryId - the dest category id
questionLink - the question link
faqSetting - the FAQSetting
Throws:
Exception - the exception

removeCategory

public void removeCategory(String categoryId,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
Remove one category in list

This function is used to remove one category in list

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

removeCategory

public void removeCategory(String categoryId)
                    throws Exception
Description copied from interface: FAQService
This method should check exists of category and remove it

Specified by:
removeCategory in interface FAQService
Parameters:
categoryId - is address id of the category need remove
Throws:
Exception - the exception

removeQuestion

public void removeQuestion(String questionId,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
Remove one question in list

This function is used to remove one question in list

Parameters:
question - identify
sProvider -
Throws:
Exception - the exception

removeQuestion

public void removeQuestion(String questionId)
                    throws Exception
Description copied from interface: FAQService
Delete question by question's id. Check question if it's existed then remove it

Specified by:
removeQuestion in interface FAQService
Parameters:
questionId - the id of question is deleted
Throws:
Exception - if question not found

saveCategory

public void saveCategory(String parentId,
                         Category cat,
                         boolean isAddNew,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws Exception
Add new or edit category in list.

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 equal 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
sProvider -
Throws:
Exception - the exception
See Also:
category

saveCategory

public void saveCategory(String parentId,
                         Category cat,
                         boolean isAddNew)
Description copied from interface: FAQService
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

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

changeStatusCategoryView

public void changeStatusCategoryView(List<String> listCateIds,
                                     org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                              throws Exception
Throws:
Exception

changeStatusCategoryView

public void changeStatusCategoryView(List<String> listCateIds)
                              throws Exception
Description copied from interface: FAQService
This method should change view of category

Specified by:
changeStatusCategoryView in interface FAQService
Parameters:
listCateIds - is address ids of the category need to change
Throws:
Exception - the exception

saveQuestion

public javax.jcr.Node saveQuestion(Question question,
                                   boolean isAddNew,
                                   org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                   FAQSetting faqSetting)
                            throws Exception
This method should create new question or update exists question

Parameters:
question - is information but user input or edit to form interface of question
isAddNew - equal true then add new question isAddNew equal false then update question
sProvider -
Throws:
Exception

saveQuestion

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

Specified by:
saveQuestion in interface FAQService
Parameters:
question - the question
isAddNew - is true if create new question node and is false if edit question node
Returns:
the question node
Throws:
Exception - if path of question nod not found

saveFAQSetting

public void saveFAQSetting(FAQSetting faqSetting,
                           String userName,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
This function is used to set some properties of FAQ.

This function is used(Users of FAQ Administrator) choose some properties in object FAQSetting

Parameters:
newSetting - is properties of object FAQSetting that user input to interface will save on data
sProvider -
Throws:
Exception - the exception

saveFAQSetting

public void saveFAQSetting(FAQSetting faqSetting,
                           String userName)
                    throws Exception
Description copied from interface: FAQService
This method to update FAQ setting.

Specified by:
saveFAQSetting in interface FAQService
Throws:
Exception - the exception

moveCategory

public void moveCategory(String categoryId,
                         String destCategoryId,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws Exception
Move one category in list to another plate in project.

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

Parameters:
categoryId - is address id of the category that user want plate
destCategoryId - is address id of the category that user want put( destination )
sProvider -
Throws:
Exception - the exception
See Also:
see category this plate but user see that category at new plate

moveCategory

public void moveCategory(String categoryId,
                         String destCategoryId)
                  throws Exception
Description copied from interface: FAQService
This method should move a category.

Specified by:
moveCategory in interface FAQService
Parameters:
categoryId - the category id should move
destCategoryId - : category is moved
Throws:
Exception - the exception

addWatch

public void addWatch(String id,
                     Watch watch,
                     org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
              throws Exception
This function is used to allow user can watch a category. You have to register your email for whenever there is new question is inserted in the category or new category then there will a notification sent to you.

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

addWatchCategory

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

Specified by:
addWatchCategory in interface FAQService
Parameters:
id - of category with user want add watch on that category
Throws:
Exception - the exception

deleteMailInWatch

public void deleteMailInWatch(String categoryId,
                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                              String user)
                       throws Exception
This function will delete watch in one category

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

deleteCategoryWatch

public void deleteCategoryWatch(String categoryId,
                                String user)
                         throws Exception
Description copied from interface: FAQService
This method will delete watch in one category

Specified by:
deleteCategoryWatch in interface FAQService
Parameters:
categoryId - is id of current category
Throws:
Exception - the exception

UnWatch

public void UnWatch(String categoryId,
                    org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                    String userCurrent)
             throws Exception
This function will un watch in one category

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

unWatchCategory

public void unWatchCategory(String categoryId,
                            String userCurrent)
                     throws Exception
Description copied from interface: FAQService
This method will un watch in one category

Specified by:
unWatchCategory in interface FAQService
Parameters:
categoryId - is id of current category
userCurrent - is user current then you un watch
Throws:
Exception - the exception

UnWatchQuestion

public void UnWatchQuestion(String questionID,
                            org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                            String userCurrent)
                     throws Exception
This function will un watch in one category

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

unWatchQuestion

public void unWatchQuestion(String questionID,
                            String userCurrent)
                     throws Exception
Description copied from interface: FAQService
This method will un watch in one question

Specified by:
unWatchQuestion in interface FAQService
userCurrent - is user current then you un watch
Throws:
Exception - the exception

getListCateIdByModerator

public List<String> getListCateIdByModerator(String user,
                                             org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                      throws Exception
This method should lookup all the categories node so find category have user in moderators and convert to category object and return list of category object

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

getListCateIdByModerator

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

Specified by:
getListCateIdByModerator in interface FAQService
Parameters:
user - the name of user
Returns:
Category list
Throws:
Exception - if can't found user

getSearchResults

public List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
                                          throws Exception
This method will return list question when user input value search

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

Specified by:
getSearchResults in interface FAQService
Parameters:
sProvider -
eventQuery - is object save value in form advanced search
Returns:
Category list
Throws:
Exception - the exception

getCategoryPath

public List<String> getCategoryPath(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                    String categoryId)
                             throws Exception
This method return path of category identify

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

getCategoryPath

public List<String> getCategoryPath(String categoryId)
                             throws Exception
Description copied from interface: FAQService
This method return path of category identify

Specified by:
getCategoryPath in interface FAQService
Returns:
list category name is sort(path of this category)
Throws:
Exception - the exception

getPendingMessages

public Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
This function will send all the pending notification message

Specified by:
getPendingMessages in interface FAQService

addLanguage

public void addLanguage(javax.jcr.Node questionNode,
                        QuestionLanguage language)
                 throws Exception
Adds the language node, when question have multiple language, each language is a child node of question node.

Specified by:
addLanguage in interface FAQService
Parameters:
questionNode - the question node which have multiple language
language - the language which is added in to questionNode
Throws:
Exception - throw an exception when save a new language node

getUserSetting

public void getUserSetting(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                           String userName,
                           FAQSetting faqSetting)
                    throws Exception
Throws:
Exception

getUserSetting

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

Specified by:
getUserSetting in interface FAQService
Parameters:
userName - the name of user
faqSetting - the setting of user
Throws:
Exception - when can't find user or faqSetting

getMessageInfo

public org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
                                                       throws Exception
Description copied from interface: FAQService
Get informations about message

Specified by:
getMessageInfo in interface FAQService
Parameters:
name - key of message
Returns:
informations contain message and email addresses.
Throws:
Exception

isAdminRole

public boolean isAdminRole(String userName,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
Throws:
Exception

isAdminRole

public boolean isAdminRole(String userName)
                    throws Exception
Description copied from interface: FAQService
Check permission of user

Specified by:
isAdminRole in interface FAQService
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

getCategoryNodeById

public javax.jcr.Node getCategoryNodeById(String categoryId,
                                          org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                   throws Exception
Throws:
Exception

getCategoryNodeById

public javax.jcr.Node getCategoryNodeById(String categoryId)
                                   throws Exception
Description copied from interface: FAQService
Get category node

Specified by:
getCategoryNodeById in interface FAQService
Parameters:
categoryId - id of category
Returns:
node of category
Throws:
Exception

addWatchQuestion

public void addWatchQuestion(String questionId,
                             Watch watch,
                             boolean isNew,
                             org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                      throws Exception
Throws:
Exception

addWatchQuestion

public void addWatchQuestion(String questionId,
                             Watch watch,
                             boolean isNew)
                      throws Exception
Description copied from interface: FAQService
Add watch for a question

Specified by:
addWatchQuestion in interface FAQService
Parameters:
questionId - id of question
watch - contains information of users
isNew - add new or edit
Throws:
Exception

getListQuestionsWatch

public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                              String currentUser,
                                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                       throws Exception
Throws:
Exception

getListQuestionsWatch

public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                              String currentUser)
                                       throws Exception
Description copied from interface: FAQService
Get list of questions that user watches

Specified by:
getListQuestionsWatch in interface FAQService
Parameters:
faqSetting - setting of user
currentUser - username
Returns:
List of questions
Throws:
Exception

importData

public void importData(String categoryId,
                       javax.jcr.Session session,
                       InputStream inputStream,
                       boolean isZip,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws Exception
Throws:
Exception

importData

public boolean importData(String categoryId,
                          InputStream inputStream,
                          boolean isZip)
                   throws Exception
Description copied from interface: FAQService
Import data to category

Specified by:
importData in interface FAQService
Returns:
informations contain message and email addresses.
Throws:
Exception

exportData

public InputStream exportData(String categoryId,
                              boolean createZipFile)
                       throws Exception
Description copied from interface: FAQService
Export category to stream

Specified by:
exportData in interface FAQService
Parameters:
categoryId - id of category
createZipFile - create zip file or not
Returns:
input stream of category
Throws:
Exception

swapCategories

public void swapCategories(String parentCateId,
                           String cateId1,
                           String cateId2,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
Throws:
Exception

swapCategories

public void swapCategories(String cateId1,
                           String cateId2)
                    throws Exception
Description copied from interface: FAQService
Swap two categories

Specified by:
swapCategories in interface FAQService
Parameters:
cateId1 - id of category 1
cateId2 - id of category 2
Throws:
Exception

saveTopicIdDiscussQuestion

public void saveTopicIdDiscussQuestion(String questionId,
                                       String pathDiscuss,
                                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                throws Exception
Throws:
Exception

saveTopicIdDiscussQuestion

public void saveTopicIdDiscussQuestion(String questionId,
                                       String pathDiscuss)
                                throws Exception
Description copied from interface: FAQService
Save topic

Specified by:
saveTopicIdDiscussQuestion in interface FAQService
Parameters:
questionId - Question to discuss
pathDiscuss - path to discussion
Throws:
Exception

getMaxindexCategory

public long getMaxindexCategory(String parentId,
                                org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                         throws Exception
Throws:
Exception

getMaxindexCategory

public long getMaxindexCategory(String parentId)
                         throws Exception
Description copied from interface: FAQService
Get max index of categories

Specified by:
getMaxindexCategory in interface FAQService
Parameters:
parentId - id of parent
Returns:
index
Throws:
Exception

deleteAnswer

public void deleteAnswer(String questionId,
                         String answerId,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws Exception
Throws:
Exception

deleteAnswer

public void deleteAnswer(String questionId,
                         String answerId)
                  throws Exception
Description copied from interface: FAQService
Remove an answer

Specified by:
deleteAnswer in interface FAQService
Parameters:
questionId - id of question
answerId - id of answer
Throws:
Exception

deleteComment

public void deleteComment(String questionId,
                          String commentId,
                          org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                   throws Exception
Throws:
Exception

deleteComment

public void deleteComment(String questionId,
                          String commentId)
                   throws Exception
Description copied from interface: FAQService
Remove comment of question

Specified by:
deleteComment in interface FAQService
Parameters:
questionId - id of question
commentId - id of comment
Throws:
Exception

saveAnswer

public void saveAnswer(String questionId,
                       Answer answer,
                       boolean isNew,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws Exception
Throws:
Exception

saveAnswer

public void saveAnswer(String questionId,
                       Answer answer,
                       boolean isNew)
                throws Exception
Description copied from interface: FAQService
Save an answer

Specified by:
saveAnswer in interface FAQService
Parameters:
questionId - id of question
answer - saved answer
isNew - save new or edit
Throws:
Exception

saveComment

public void saveComment(String questionId,
                        Comment comment,
                        boolean isNew,
                        org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                 throws Exception
Throws:
Exception

saveComment

public void saveComment(String questionId,
                        Comment comment,
                        boolean isNew)
                 throws Exception
Description copied from interface: FAQService
Save comment of question

Specified by:
saveComment in interface FAQService
Parameters:
questionId - id of question
comment - saved comment
isNew - save new or edit
Throws:
Exception

getCommentById

public Comment getCommentById(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                              String questionId,
                              String commentId)
                       throws Exception
Throws:
Exception

getCommentById

public Comment getCommentById(String questionId,
                              String commentId)
                       throws Exception
Description copied from interface: FAQService
Get comment of question

Specified by:
getCommentById in interface FAQService
Parameters:
questionId - id of question
commentId - id of comment
Returns:
comment
Throws:
Exception

getAnswerById

public Answer getAnswerById(String questionId,
                            String answerid,
                            org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                     throws Exception
Throws:
Exception

getAnswerById

public Answer getAnswerById(String questionId,
                            String answerid)
                     throws Exception
Description copied from interface: FAQService
Get answer of question

Specified by:
getAnswerById in interface FAQService
Parameters:
questionId - id of question
answerid - id of answer
Returns:
an Answer
Throws:
Exception

saveAnswer

public void saveAnswer(String questionId,
                       Answer[] answers,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws Exception
Deprecated. use saveAnswer(String questionId, Answer[] answers)

Throws:
Exception

saveAnswer

public void saveAnswer(String questionId,
                       Answer[] answers)
                throws Exception
Description copied from interface: FAQService
Save an answer

Specified by:
saveAnswer in interface FAQService
Parameters:
questionId - id of question
answers - saved answers
Throws:
Exception

getPageListAnswer

public JCRPageList getPageListAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                     String questionId,
                                     boolean isSortByVote)
                              throws Exception
Throws:
Exception

getPageListAnswer

public JCRPageList getPageListAnswer(String questionId,
                                     boolean isSortByVote)
                              throws Exception
Description copied from interface: FAQService
Get answers of question

Specified by:
getPageListAnswer in interface FAQService
Parameters:
questionId - id of question
isSortByVote - sort by vote
Returns:
answers page list
Throws:
Exception

getPageListComment

public JCRPageList getPageListComment(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                      String questionId)
                               throws Exception
Throws:
Exception

getPageListComment

public JCRPageList getPageListComment(String questionId)
                               throws Exception
Description copied from interface: FAQService
Get comments of question

Specified by:
getPageListComment in interface FAQService
Parameters:
questionId - id of question
Returns:
comment page list
Throws:
Exception

getListCategoriesWatch

public QuestionPageList getListCategoriesWatch(String userId,
                                               org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                        throws Exception
Throws:
Exception

getWatchedCategoryByUser

public QuestionPageList getWatchedCategoryByUser(String userId)
                                          throws Exception
Description copied from interface: FAQService
Get list questions that user watches

Specified by:
getWatchedCategoryByUser in interface FAQService
Parameters:
userId - username
Returns:
question page list
Throws:
Exception

getUserAvatar

public FileAttachment getUserAvatar(String userName,
                                    org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                             throws Exception
Throws:
Exception

getUserAvatar

public FileAttachment getUserAvatar(String userName)
                             throws Exception
Description copied from interface: FAQService
Get avatar of user

Specified by:
getUserAvatar in interface FAQService
Parameters:
userName - username
Returns:
avatar of user
Throws:
Exception

saveUserAvatar

public void saveUserAvatar(String userId,
                           FileAttachment fileAttachment,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws Exception
Throws:
Exception

saveUserAvatar

public void saveUserAvatar(String userId,
                           FileAttachment fileAttachment)
                    throws Exception
Description copied from interface: FAQService
Save avatar of an user

Specified by:
saveUserAvatar in interface FAQService
Parameters:
userId - username
fileAttachment - avatar of user
Throws:
Exception

setDefaultAvatar

public void setDefaultAvatar(String userName,
                             org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                      throws Exception
Throws:
Exception

setDefaultAvatar

public void setDefaultAvatar(String userName)
                      throws Exception
Description copied from interface: FAQService
set default avatar for an user

Specified by:
setDefaultAvatar in interface FAQService
Parameters:
userName - username
Throws:
Exception

getWatchByUser

public boolean getWatchByUser(String userId,
                              String cateId,
                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                       throws Exception
Throws:
Exception

isUserWatched

public boolean isUserWatched(String userId,
                             String cateId)
Description copied from interface: FAQService
Check that user is watching a category

Specified by:
isUserWatched in interface FAQService
Parameters:
userId - username
cateId - id of category
Returns:
true if user is watching and false if isn't

getPendingQuestionsByCategory

public QuestionPageList getPendingQuestionsByCategory(String categoryId,
                                                      org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                      FAQSetting faqSetting)
                                               throws Exception
Throws:
Exception

getPendingQuestionsByCategory

public QuestionPageList getPendingQuestionsByCategory(String categoryId,
                                                      FAQSetting faqSetting)
                                               throws Exception
Description copied from interface: FAQService
Get list pending questions in a category

Specified by:
getPendingQuestionsByCategory in interface FAQService
Parameters:
categoryId - id of category
faqSetting - settings
Returns:
question page list
Throws:
Exception

isExisting

public boolean isExisting(String path)
                   throws Exception
Description copied from interface: FAQService
Check a path exist or not

Specified by:
isExisting in interface FAQService
Parameters:
path - path need check
Returns:
exist or not
Throws:
Exception

getCategoryPathOf

public String getCategoryPathOf(String id)
                         throws Exception
Description copied from interface: FAQService
get path of Category by id

Specified by:
getCategoryPathOf in interface FAQService
Parameters:
id - category id
Returns:
path of category
Throws:
Exception

getQuestionContents

public List<String> getQuestionContents(List<String> paths)
                                 throws Exception
Description copied from interface: FAQService
Get titles of questions

Specified by:
getQuestionContents in interface FAQService
Parameters:
paths - path of questions
Returns:
list titles of questions
Throws:
Exception

getRelationQuestion

public Map<String,String> getRelationQuestion(List<String> paths)
                                       throws Exception
Description copied from interface: FAQService
Get titles of questions active

Specified by:
getRelationQuestion in interface FAQService
Parameters:
paths - path of questions
Returns:
list titles of questions
Throws:
Exception

getQuestionNodeById

public javax.jcr.Node getQuestionNodeById(String path)
                                   throws Exception
Description copied from interface: FAQService
Get question node

Specified by:
getQuestionNodeById in interface FAQService
Parameters:
path - id of question
Returns:
question node
Throws:
Exception

isModerateAnswer

public boolean isModerateAnswer(String id)
                         throws Exception
Description copied from interface: FAQService
Check moderate answer or not

Specified by:
isModerateAnswer in interface FAQService
Parameters:
id - id of category
Returns:
answer or not
Throws:
Exception

isModerateQuestion

public boolean isModerateQuestion(String id)
                           throws Exception
Description copied from interface: FAQService
Check question has moderator or not

Specified by:
isModerateQuestion in interface FAQService
Parameters:
id - id of question
Returns:
is moderate or not
Throws:
Exception

getParentCategoriesName

public String getParentCategoriesName(String path)
                               throws Exception
Description copied from interface: FAQService
Get name of parent category

Specified by:
getParentCategoriesName in interface FAQService
Parameters:
path - id of category
Returns:
name of parent category
Throws:
Exception

getListMailInWatch

public QuestionPageList getListMailInWatch(String categoryId)
                                    throws Exception
Description copied from interface: FAQService
Get email addresses that watch in a category

Specified by:
getListMailInWatch in interface FAQService
Parameters:
categoryId - id of category
Returns:
question page list
Throws:
Exception

isCategoryModerator

public boolean isCategoryModerator(String categoryId,
                                   String user)
                            throws Exception
Description copied from interface: FAQService
Check user is moderator or not

Specified by:
isCategoryModerator in interface FAQService
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

public void addLanguage(String questionPath,
                        QuestionLanguage language)
                 throws Exception
Description copied from interface: FAQService
Add language to a question

Specified by:
addLanguage in interface FAQService
Parameters:
questionPath - patch of question
language - question language
Throws:
Exception

deleteAnswerQuestionLang

public void deleteAnswerQuestionLang(String questionPath,
                                     String answerId,
                                     String language)
                              throws Exception
Description copied from interface: FAQService
Delete language in a answer

Specified by:
deleteAnswerQuestionLang in interface FAQService
Parameters:
questionPath - path of question
answerId - id of answer
language - deleted language
Throws:
Exception

deleteCommentQuestionLang

public void deleteCommentQuestionLang(String questionPath,
                                      String commentId,
                                      String language)
                               throws Exception
Description copied from interface: FAQService
Delete language in a comment

Specified by:
deleteCommentQuestionLang in interface FAQService
Parameters:
questionPath - path of question
commentId - id of comment
language - deleted language
Throws:
Exception

getQuestionLanguageByLanguage

public QuestionLanguage getQuestionLanguageByLanguage(String questionPath,
                                                      String language)
                                               throws Exception
Description copied from interface: FAQService
Get language of question

Specified by:
getQuestionLanguageByLanguage in interface FAQService
Parameters:
questionPath - path of question
language - got language
Returns:
Language of question
Throws:
Exception

getCommentById

public Comment getCommentById(String questionPath,
                              String commentId,
                              String language)
                       throws Exception
Description copied from interface: FAQService
Get Comment of question

Specified by:
getCommentById in interface FAQService
Parameters:
questionPath - path of question
commentId - id of comment
Returns:
comment of question
Throws:
Exception

getAnswerById

public Answer getAnswerById(String questionPath,
                            String answerid,
                            String language)
                     throws Exception
Description copied from interface: FAQService
Get answer object

Specified by:
getAnswerById in interface FAQService
Parameters:
questionPath - path of question
answerid - id of answer
Returns:
answer has inputed id
Throws:
Exception

saveAnswer

public void saveAnswer(String questionPath,
                       Answer answer,
                       String language)
                throws Exception
Description copied from interface: FAQService
Save an answer of question

Specified by:
saveAnswer in interface FAQService
Parameters:
questionPath - path of question
answer - object answer want to save
language - language of answer
Throws:
Exception

saveAnswer

public void saveAnswer(String questionPath,
                       QuestionLanguage questionLanguage)
                throws Exception
Description copied from interface: FAQService
Save an answer of question

Specified by:
saveAnswer in interface FAQService
Parameters:
questionPath - path of question
questionLanguage - language of answer
Throws:
Exception

saveComment

public void saveComment(String questionPath,
                        Comment comment,
                        String languge)
                 throws Exception
Description copied from interface: FAQService
Save comment of a question

Specified by:
saveComment in interface FAQService
Parameters:
questionPath - path of question
comment - comment want to save
languge - language of comment
Throws:
Exception

removeLanguage

public void removeLanguage(String questionPath,
                           List<String> listLanguage)
Description copied from interface: FAQService
Remove languages from question

Specified by:
removeLanguage in interface FAQService
Parameters:
questionPath - path of question
listLanguage - removed languages

voteAnswer

public void voteAnswer(String answerPath,
                       String userName,
                       boolean isUp)
                throws Exception
Description copied from interface: FAQService
vote for an answer

Specified by:
voteAnswer in interface FAQService
Parameters:
answerPath - path of answer
userName - username of user vote for answer
isUp - up or not
Throws:
Exception

voteQuestion

public void voteQuestion(String questionPath,
                         String userName,
                         int number)
                  throws Exception
Description copied from interface: FAQService
vote for a question

Specified by:
voteQuestion in interface FAQService
Parameters:
questionPath - path of question
userName - username of user vote for question
number - value user vote
Throws:
Exception

unVoteQuestion

public void unVoteQuestion(String questionPath,
                           String userName)
                    throws Exception
Description copied from interface: FAQService
Remove vote for question

Specified by:
unVoteQuestion in interface FAQService
Parameters:
questionPath - path of question
userName - username remove vote
Throws:
Exception

getModeratorsOf

public String[] getModeratorsOf(String path)
                         throws Exception
Description copied from interface: FAQService
Get moderators of question or category

Specified by:
getModeratorsOf in interface FAQService
Parameters:
path - path of question or category
Returns:
array users are moderator
Throws:
Exception

isViewAuthorInfo

public boolean isViewAuthorInfo(String id)
Description copied from interface: FAQService
Check view author information or not

Specified by:
isViewAuthorInfo in interface FAQService
Parameters:
id - id of question
Returns:
is view author information or not

existingCategories

public long existingCategories()
                        throws Exception
Description copied from interface: FAQService
Get number of categories

Specified by:
existingCategories in interface FAQService
Returns:
number of categories
Throws:
Exception

getCategoryNameOf

public String getCategoryNameOf(String categoryPath)
                         throws Exception
Description copied from interface: FAQService
Get name of category

Specified by:
getCategoryNameOf in interface FAQService
Parameters:
categoryPath - path of category
Returns:
name of category
Throws:
Exception

getQuickQuestionsByListCatetory

public List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId,
                                                      boolean isNotYetAnswer)
                                               throws Exception
Description copied from interface: FAQService
Get quick questions

Specified by:
getQuickQuestionsByListCatetory in interface FAQService
Parameters:
listCategoryId - id of some categories
isNotYetAnswer - is answer or not
Returns:
list of questions
Throws:
Exception

listingCategoryTree

public List<Cate> listingCategoryTree()
                               throws Exception
Description copied from interface: FAQService
Get list of categories

Specified by:
listingCategoryTree in interface FAQService
Returns:
list of categories
Throws:
Exception

getWatchByCategory

public List<Watch> getWatchByCategory(String categoryId)
                               throws Exception
Description copied from interface: FAQService
Get list of watches

Specified by:
getWatchByCategory in interface FAQService
Parameters:
categoryId - id of category
Returns:
list of watches in a category
Throws:
Exception

hasWatch

public boolean hasWatch(String categoryPath)
Description copied from interface: FAQService
Get information has watch or not

Specified by:
hasWatch in interface FAQService
Parameters:
categoryPath - path of category
Returns:
has watch or has not

getCategoryInfo

public CategoryInfo getCategoryInfo(String categoryPath,
                                    List<String> categoryIdScoped)
                             throws Exception
Description copied from interface: FAQService
Get informations about category

Specified by:
getCategoryInfo in interface FAQService
Parameters:
categoryPath - path of category
categoryIdScoped - list sub of category
Returns:
informations in CategoryInfo object
Throws:
Exception

getTemplate

public byte[] getTemplate()
                   throws Exception
Description copied from interface: FAQService
Get template of questions

Specified by:
getTemplate in interface FAQService
Returns:
template
Throws:
Exception

saveTemplate

public void saveTemplate(String str)
                  throws Exception
Description copied from interface: FAQService
Save a template

Specified by:
saveTemplate in interface FAQService
Parameters:
str - template
Throws:
Exception

isCategoryExist

public boolean isCategoryExist(String name,
                               String path)
Description copied from interface: FAQService
Check category is exist or not

Specified by:
isCategoryExist in interface FAQService
Parameters:
name - name of category
path - path of category
Returns:
is exist or not

updateQuestionRelatives

public void updateQuestionRelatives(String questionPath,
                                    String[] relatives)
                             throws Exception
Description copied from interface: FAQService
Update relatives for a question

Specified by:
updateQuestionRelatives in interface FAQService
Parameters:
questionPath - path of question
relatives - input relatives
Throws:
Exception

createAnswerRSS

public InputStream createAnswerRSS(String cateId)
                            throws Exception
Description copied from interface: FAQService
Create RSS for answer

Specified by:
createAnswerRSS in interface FAQService
Parameters:
cateId - id of category
Returns:
stream of answer rss
Throws:
Exception

reCalculateLastActivityOfQuestion

public void reCalculateLastActivityOfQuestion(String absPathOfProp)
                                       throws Exception
Description copied from interface: FAQService
Save last active information of question

Specified by:
reCalculateLastActivityOfQuestion in interface FAQService
Parameters:
absPathOfProp - path of question
Throws:
Exception

addListenerPlugin

public void addListenerPlugin(AnswerEventListener listener)
                       throws Exception
Description copied from interface: FAQService
Add listener for answer

Specified by:
addListenerPlugin in interface FAQService
Parameters:
listener - answer event listener
Throws:
Exception

calculateDeletedUser

public void calculateDeletedUser(String userName)
                          throws Exception
Specified by:
calculateDeletedUser in interface FAQService
Throws:
Exception

readCategoryProperty

public Object readCategoryProperty(String categoryId,
                                   String propertyName,
                                   Class returnType)
                            throws Exception
Description copied from interface: FAQService
read property of the category by its name

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

readQuestionProperty

public Object readQuestionProperty(String questionId,
                                   String propertyName,
                                   Class returnType)
                            throws Exception
Description copied from interface: FAQService
read property of the question by its name

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


Copyright © 2013 eXo Platform SAS. All Rights Reserved.