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 java.lang.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
           
static int QUESTION
           
static int SEND_EMAIL
           
 
Constructor Summary
FAQServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchy, org.exoplatform.services.jcr.RepositoryService rService, org.exoplatform.container.xml.InitParams params)
           
 
Method Summary
 void addInitialDataPlugin(InitialDataPlugin plugin)
          Plugin to initialize default FAQ data
 void addInitRssPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
           
 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(java.lang.String questionPath, QuestionLanguage language)
           
 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(java.lang.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(java.lang.String id, Watch watch)
          This function is used to allow user can watch a category.
 void addWatchQuestion(java.lang.String questionId, Watch watch, boolean isNew)
           
 void addWatchQuestion(java.lang.String questionId, Watch watch, boolean isNew, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void changeStatusCategoryView(java.util.List<java.lang.String> listCateIds)
           
 void changeStatusCategoryView(java.util.List<java.lang.String> listCateIds, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void deleteAnswer(java.lang.String questionId, java.lang.String answerId)
           
 void deleteAnswer(java.lang.String questionId, java.lang.String answerId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void deleteAnswerQuestionLang(java.lang.String questionPath, java.lang.String answerId, java.lang.String language)
           
 void deleteCategoryWatch(java.lang.String categoryId, java.lang.String user)
          This method will delete watch in one category
 void deleteComment(java.lang.String questionId, java.lang.String commentId)
           
 void deleteComment(java.lang.String questionId, java.lang.String commentId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void deleteCommentQuestionLang(java.lang.String questionPath, java.lang.String commentId, java.lang.String language)
           
 void deleteMailInWatch(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String user)
          This function will delete watch in one category
 long existingCategories()
           
 java.io.InputStream exportData(java.lang.String categoryId, boolean createZipFile)
           
 java.util.List<java.lang.String> getActiveBBCode()
           
 java.util.List<BBCode> getAllBBCode()
           
 java.util.List<Category> getAllCategories()
          This method should lookup all the category and convert to category object and return list of category object
 java.util.List<Category> getAllCategories(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          This method get all the category
 java.util.List<java.lang.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(java.lang.String categoryId, FAQSetting faqSetting)
          Get all questions of the category.
 QuestionPageList getAllQuestionsByCatetory(java.lang.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(java.lang.String questionId, java.lang.String answerid)
           
 Answer getAnswerById(java.lang.String questionId, java.lang.String answerid, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 Answer getAnswerById(java.lang.String questionPath, java.lang.String answerid, java.lang.String language)
           
 BBCode getBBcode(java.lang.String id)
           
 Category getCategoryById(java.lang.String categoryId)
          This method should lookup category via identify and convert to Category object and return
 Category getCategoryById(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Returns an category that can then be get property of this category.
 long[] getCategoryInfo(java.lang.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(java.lang.String categoryPath, java.util.List<java.lang.String> categoryIdScoped)
           
 long[] getCategoryInfo(java.lang.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
 java.lang.String getCategoryNameOf(java.lang.String categoryPath)
           
 javax.jcr.Node getCategoryNodeById(java.lang.String categoryId)
           
 javax.jcr.Node getCategoryNodeById(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 java.util.List<java.lang.String> getCategoryPath(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String categoryId)
          This method return path of category identify
 java.util.List<java.lang.String> getCategoryPath(java.lang.String categoryId)
          This method return path of category identify
 java.lang.String getCategoryPathOf(java.lang.String id)
           
 java.lang.String getCategoryPathOfQuestion(java.lang.String questionPath)
          Get path of question.
 java.lang.String getCategoryPathOfQuestion(java.lang.String questionPath, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 Comment getCommentById(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String questionId, java.lang.String commentId)
           
 Comment getCommentById(java.lang.String questionId, java.lang.String commentId)
           
 Comment getCommentById(java.lang.String questionPath, java.lang.String commentId, java.lang.String language)
           
 QuestionPageList getListCategoriesWatch(java.lang.String userId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 java.util.List<java.lang.String> getListCateIdByModerator(java.lang.String user)
          Get all categories of user.
 java.util.List<java.lang.String> getListCateIdByModerator(java.lang.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(java.lang.String categoryId)
           
 QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, java.lang.String currentUser)
           
 QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, java.lang.String currentUser, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 long getMaxindexCategory(java.lang.String parentId)
           
 long getMaxindexCategory(java.lang.String parentId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 NotifyInfo getMessageInfo(java.lang.String name)
           
 java.lang.String[] getModeratorsOf(java.lang.String path)
           
 JCRPageList getPageListAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String questionId, java.lang.Boolean isSortByVote)
           
 JCRPageList getPageListAnswer(java.lang.String questionId, java.lang.Boolean isSortByVote)
           
 JCRPageList getPageListComment(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String questionId)
           
 JCRPageList getPageListComment(java.lang.String questionId)
           
 java.lang.String getParentCategoriesName(java.lang.String path)
           
 QuestionPageList getPendingQuestionsByCategory(java.lang.String categoryId, FAQSetting faqSetting)
           
 QuestionPageList getPendingQuestionsByCategory(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, FAQSetting faqSetting)
           
 Question getQuestionById(java.lang.String questionId)
          Lookup the question node via identify, convert to question object and return
 Question getQuestionById(java.lang.String questionId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          This method should get question node via identify
 java.util.List<java.lang.String> getQuestionContents(java.util.List<java.lang.String> paths)
           
 QuestionLanguage getQuestionLanguageByLanguage(java.lang.String questionPath, java.lang.String language)
           
 java.util.List<QuestionLanguage> getQuestionLanguages(java.lang.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.
 java.util.List<QuestionLanguage> getQuestionLanguages(java.lang.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(java.lang.String path)
           
 QuestionPageList getQuestionsByCatetory(java.lang.String categoryId, FAQSetting faqSetting)
          Get questions are activagted and approved in the category.
 QuestionPageList getQuestionsByCatetory(java.lang.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(java.util.List<java.lang.String> listCategoryId, boolean isNotYetAnswer)
          Get questions in list categories.
 QuestionPageList getQuestionsByListCatetory(java.util.List<java.lang.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
 javax.jcr.NodeIterator getQuestionsIterator()
           
 javax.jcr.NodeIterator getQuestionsIterator(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 QuestionPageList getQuestionsNotYetAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String categoryId, FAQSetting setting)
          This method get all question node have not yet answer and convert to list of question object (QuestionPageList)
 QuestionPageList getQuestionsNotYetAnswer(java.lang.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
 java.util.List<Question> getQuickQuestionsByListCatetory(java.util.List<java.lang.String> listCategoryId, boolean isNotYetAnswer)
           
 java.util.List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
          This method will return list question when user input value search
 java.util.List<Category> getSubCategories(java.lang.String categoryId, FAQSetting faqSetting, boolean isGetAll, java.util.List<java.lang.String> userView)
          This method should lookup all sub-categories of a category and convert to category object and return list of category object
 java.util.List<Category> getSubCategories(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, FAQSetting faqSetting, boolean isGetAll, java.util.List<java.lang.String> userView)
          Returns an list category that can then be view on the screen.
 byte[] getTemplate()
           
 FileAttachment getUserAvatar(java.lang.String userName)
           
 FileAttachment getUserAvatar(java.lang.String userName, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void getUserSetting(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String userName, FAQSetting faqSetting)
           
 void getUserSetting(java.lang.String userName, FAQSetting faqSetting)
          Get setting of user to view data (categories and questions).
 java.util.List<Watch> getWatchByCategory(java.lang.String categoryId)
           
 boolean getWatchByUser(java.lang.String userId, java.lang.String cateId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 QuestionPageList getWatchedCategoryByUser(java.lang.String userId)
           
 boolean hasWatch(java.lang.String categoryPath)
           
 boolean importData(java.lang.String categoryId, java.io.InputStream inputStream, boolean isZip)
           
 void importData(java.lang.String categoryId, javax.jcr.Session session, java.io.InputStream inputStream, boolean isZip, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 boolean isAdminRole(java.lang.String userName)
          Check permission of user
 boolean isAdminRole(java.lang.String userName, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 boolean isCategoryExist(java.lang.String name, java.lang.String path)
           
 boolean isCategoryModerator(java.lang.String categoryPath, java.lang.String user)
           
 boolean isExisting(java.lang.String path)
           
 boolean isModerateAnswer(java.lang.String id)
           
 boolean isModerateQuestion(java.lang.String id)
           
 boolean isUserWatched(java.lang.String userId, java.lang.String cateId)
           
 boolean isViewAuthorInfo(java.lang.String id)
           
 java.util.List<Cate> listingCategoryTree()
           
 void moveCategory(java.lang.String categoryId, java.lang.String destCategoryId)
           
 void moveCategory(java.lang.String categoryId, java.lang.String destCategoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Move one category in list to another plate in project.
 void moveQuestions(java.util.List<java.lang.String> questions, java.lang.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(java.util.List<java.lang.String> questions, java.lang.String destCategoryId, java.lang.String questionLink, FAQSetting faqSetting)
          Move all of questions to category which have id is specified
 void removeBBCode(java.lang.String bbcodeId)
           
 void removeCategory(java.lang.String categoryId)
          This method should check exists of category and remove it
 void removeCategory(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Remove one category in list
 void removeLanguage(java.lang.String questionPath, java.util.List<java.lang.String> listLanguage)
           
 void removeQuestion(java.lang.String questionId)
          Delete question by question's id.
 void removeQuestion(java.lang.String questionId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Remove one question in list
 void saveAnswer(java.lang.String questionId, Answer[] answers)
           
 void saveAnswer(java.lang.String questionId, Answer[] answers, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void saveAnswer(java.lang.String questionId, Answer answer, boolean isNew)
           
 void saveAnswer(java.lang.String questionId, Answer answer, boolean isNew, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void saveAnswer(java.lang.String questionPath, Answer answer, java.lang.String language)
           
 void saveAnswer(java.lang.String questionPath, QuestionLanguage questionLanguage)
           
 void saveBBCode(java.util.List<BBCode> bbcodes)
           
 void saveCategory(java.lang.String parentId, Category cat, boolean isAddNew)
          This method should check exists category or NOT to create new or update exists category
 void saveCategory(java.lang.String parentId, Category cat, boolean isAddNew, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Add new or edit category in list.
 void saveComment(java.lang.String questionId, Comment comment, boolean isNew)
           
 void saveComment(java.lang.String questionId, Comment comment, boolean isNew, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void saveComment(java.lang.String questionPath, Comment comment, java.lang.String languge)
           
 void saveFAQSetting(FAQSetting faqSetting, java.lang.String userName)
          This method to update FAQ setting.
 void saveFAQSetting(FAQSetting faqSetting, java.lang.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(java.lang.String str)
           
 void saveTopicIdDiscussQuestion(java.lang.String questionId, java.lang.String pathDiscuss)
           
 void saveTopicIdDiscussQuestion(java.lang.String questionId, java.lang.String pathDiscuss, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void saveUserAvatar(java.lang.String userId, FileAttachment fileAttachment)
           
 void saveUserAvatar(java.lang.String userId, FileAttachment fileAttachment, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void sendMessage(org.exoplatform.services.mail.Message message)
          This function will send message to address but you want send
 void setDefaultAvatar(java.lang.String userName)
           
 void setDefaultAvatar(java.lang.String userName, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void start()
           
 void stop()
           
 void swapCategories(java.lang.String cateId1, java.lang.String cateId2)
           
 void swapCategories(java.lang.String parentCateId, java.lang.String cateId1, java.lang.String cateId2, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 void unVoteQuestion(java.lang.String questionPath, java.lang.String userName)
           
 void UnWatch(java.lang.String categoryId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String userCurrent)
          This function will un watch in one category
 void unWatchCategory(java.lang.String categoryId, java.lang.String userCurrent)
          This method will un watch in one category
 void UnWatchQuestion(java.lang.String questionID, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String userCurrent)
          This function will un watch in one category
 void unWatchQuestion(java.lang.String questionID, java.lang.String userCurrent)
          This method will un watch in one question
 void updateQuestionRelatives(java.lang.String questionPath, java.lang.String[] relatives)
           
 void voteAnswer(java.lang.String answerPath, java.lang.String userName, boolean isUp)
           
 void voteQuestion(java.lang.String questionPath, java.lang.String userName, int number)
           
 
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
Constructor Detail

FAQServiceImpl

public FAQServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager,
                      org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchy,
                      org.exoplatform.services.jcr.RepositoryService rService,
                      org.exoplatform.container.xml.InitParams params)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

addPlugin

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

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

addRolePlugin

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

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

addInitialDataPlugin

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

Specified by:
addInitialDataPlugin in interface FAQService
Throws:
java.lang.Exception

addInitRssPlugin

public void addInitRssPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                      throws java.lang.Exception
Specified by:
addInitRssPlugin in interface FAQService
Throws:
java.lang.Exception

addTemplatePlugin

public void addTemplatePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                       throws java.lang.Exception
Throws:
java.lang.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 java.util.List<java.lang.String> getAllFAQAdmin()
                                                throws java.lang.Exception
This method get all admin in FAQ

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

getAllCategories

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

Specified by:
getAllCategories in interface FAQServiceLegacy
Parameters:
sProvider - is session provider
Returns:
Category list
Throws:
java.lang.Exception - the exception

getAllCategories

public java.util.List<Category> getAllCategories()
                                          throws java.lang.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:
java.lang.Exception - the exception

getAllQuestions

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

Specified by:
getAllQuestions in interface FAQServiceLegacy
Parameters:
sProvider -
Returns:
QuestionPageList
Throws:
java.lang.Exception - the exception

getAllQuestions

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

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

getQuestionsNotYetAnswer

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

Specified by:
getQuestionsNotYetAnswer in interface FAQServiceLegacy
Parameters:
sProvider -
Returns:
QuestionPageList
Throws:
java.lang.Exception - the exception

getQuestionsNotYetAnswer

public QuestionPageList getQuestionsNotYetAnswer(java.lang.String categoryId,
                                                 boolean isApproved)
                                          throws java.lang.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:
java.lang.Exception - if lost attachment

getCategoryInfo

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

Specified by:
getCategoryInfo in interface FAQServiceLegacy
Parameters:
categoryId -
sProvider -
Returns:
number of (sub-categories, questions, questions is not approved,question is have not yet answered)
Throws:
java.lang.Exception - the exception

getCategoryInfo

public long[] getCategoryInfo(java.lang.String categoryId,
                              FAQSetting setting)
                       throws java.lang.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:
java.lang.Exception - if not found category by id if not found question or lose file attach

getCategoryById

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

Specified by:
getCategoryById in interface FAQServiceLegacy
Parameters:
categoryId - is address id of the category so you want get
sProvider -
Returns:
category is id equal categoryId
Throws:
java.lang.Exception - the exception
See Also:
category

getCategoryById

public Category getCategoryById(java.lang.String categoryId)
                         throws java.lang.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:
java.lang.Exception - the exception
See Also:
category

getQuestionById

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

Specified by:
getQuestionById in interface FAQServiceLegacy
Parameters:
question - identify
sProvider -
Returns:
Question
Throws:
java.lang.Exception - the exception

getQuestionById

public Question getQuestionById(java.lang.String questionId)
                         throws java.lang.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:
java.lang.Exception - the exception

getQuestionsByCatetory

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

Specified by:
getQuestionsByCatetory in interface FAQServiceLegacy
Parameters:
Category - identify
sProvider -
Returns:
QuestionPageList
Throws:
java.lang.Exception - the exception

getQuestionsByCatetory

public QuestionPageList getQuestionsByCatetory(java.lang.String categoryId,
                                               FAQSetting faqSetting)
                                        throws java.lang.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:
java.lang.Exception - if can't found category

getAllQuestionsByCatetory

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

Specified by:
getAllQuestionsByCatetory in interface FAQServiceLegacy
Parameters:
Category - identify
sProvider -
Returns:
QuestionPageList
Throws:
java.lang.Exception - the exception

getAllQuestionsByCatetory

public QuestionPageList getAllQuestionsByCatetory(java.lang.String categoryId,
                                                  FAQSetting faqSetting)
                                           throws java.lang.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:
java.lang.Exception - when category not found

getQuestionsByListCatetory

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

Specified by:
getQuestionsByListCatetory in interface FAQServiceLegacy
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:
java.lang.Exception - the exception

getQuestionsByListCatetory

public QuestionPageList getQuestionsByListCatetory(java.util.List<java.lang.String> listCategoryId,
                                                   boolean isNotYetAnswer)
                                            throws java.lang.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:
java.lang.Exception - the exception

getCategoryPathOfQuestion

public java.lang.String getCategoryPathOfQuestion(java.lang.String questionPath,
                                                  org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                           throws java.lang.Exception
Specified by:
getCategoryPathOfQuestion in interface FAQServiceLegacy
Throws:
java.lang.Exception

getCategoryPathOfQuestion

public java.lang.String getCategoryPathOfQuestion(java.lang.String questionPath)
                                           throws java.lang.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:
java.lang.Exception

getQuestionLanguages

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

Specified by:
getQuestionLanguages in interface FAQServiceLegacy
Parameters:
Question - identify
sProvider -
Returns:
language list
Throws:
java.lang.Exception - the exception

getQuestionLanguages

public java.util.List<QuestionLanguage> getQuestionLanguages(java.lang.String questionId)
                                                      throws java.lang.Exception
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
Throws:
java.lang.Exception - when question not found

getSubCategories

public java.util.List<Category> getSubCategories(java.lang.String categoryId,
                                                 org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                 FAQSetting faqSetting,
                                                 boolean isGetAll,
                                                 java.util.List<java.lang.String> userView)
                                          throws java.lang.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

Specified by:
getSubCategories in interface FAQServiceLegacy
Parameters:
categoryId - is address id of the category
sProvider -
userView - TODO
Returns:
List parent category or list sub category
Throws:
java.lang.Exception - the exception
See Also:
category

getSubCategories

public java.util.List<Category> getSubCategories(java.lang.String categoryId,
                                                 FAQSetting faqSetting,
                                                 boolean isGetAll,
                                                 java.util.List<java.lang.String> userView)
                                          throws java.lang.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 - TODO
Returns:
Category list
Throws:
java.lang.Exception - the exception

moveQuestions

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

Specified by:
moveQuestions in interface FAQServiceLegacy
Parameters:
Question - identify list
destination - category identify
sProvider -
Throws:
java.lang.Exception - the exception

moveQuestions

public void moveQuestions(java.util.List<java.lang.String> questions,
                          java.lang.String destCategoryId,
                          java.lang.String questionLink,
                          FAQSetting faqSetting)
                   throws java.lang.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 - TODO
faqSetting - TODO
Throws:
java.lang.Exception - the exception

removeCategory

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

This function is used to remove one category in list

Specified by:
removeCategory in interface FAQServiceLegacy
Parameters:
categoryId - is address id of the category need remove
sProvider -
Throws:
java.lang.Exception - the exception

removeCategory

public void removeCategory(java.lang.String categoryId)
                    throws java.lang.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:
java.lang.Exception - the exception

removeQuestion

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

This function is used to remove one question in list

Specified by:
removeQuestion in interface FAQServiceLegacy
Parameters:
question - identify
sProvider -
Throws:
java.lang.Exception - the exception

removeQuestion

public void removeQuestion(java.lang.String questionId)
                    throws java.lang.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:
java.lang.Exception - if question not found

saveCategory

public void saveCategory(java.lang.String parentId,
                         Category cat,
                         boolean isAddNew,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws java.lang.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

Specified by:
saveCategory in interface FAQServiceLegacy
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:
java.lang.Exception - the exception
See Also:
category

saveCategory

public void saveCategory(java.lang.String parentId,
                         Category cat,
                         boolean isAddNew)
                  throws java.lang.Exception
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
Throws:
java.lang.Exception - the exception
See Also:
category

changeStatusCategoryView

public void changeStatusCategoryView(java.util.List<java.lang.String> listCateIds,
                                     org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                              throws java.lang.Exception
Specified by:
changeStatusCategoryView in interface FAQServiceLegacy
Throws:
java.lang.Exception

changeStatusCategoryView

public void changeStatusCategoryView(java.util.List<java.lang.String> listCateIds)
                              throws java.lang.Exception
Specified by:
changeStatusCategoryView in interface FAQService
Throws:
java.lang.Exception

saveQuestion

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

Specified by:
saveQuestion in interface FAQServiceLegacy
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:
java.lang.Exception

saveQuestion

public javax.jcr.Node saveQuestion(Question question,
                                   boolean isAddNew,
                                   FAQSetting faqSetting)
                            throws java.lang.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:
java.lang.Exception - if path of question nod not found

saveFAQSetting

public void saveFAQSetting(FAQSetting faqSetting,
                           java.lang.String userName,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws java.lang.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

Specified by:
saveFAQSetting in interface FAQServiceLegacy
Parameters:
newSetting - is properties of object FAQSetting that user input to interface will save on data
sProvider -
Throws:
java.lang.Exception - the exception

saveFAQSetting

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

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

moveCategory

public void moveCategory(java.lang.String categoryId,
                         java.lang.String destCategoryId,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws java.lang.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

Specified by:
moveCategory in interface FAQServiceLegacy
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:
java.lang.Exception - the exception
See Also:
see category this plate but user see that category at new plate

moveCategory

public void moveCategory(java.lang.String categoryId,
                         java.lang.String destCategoryId)
                  throws java.lang.Exception
Specified by:
moveCategory in interface FAQService
Throws:
java.lang.Exception

addWatch

public void addWatch(java.lang.String id,
                     Watch watch,
                     org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
              throws java.lang.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.

Specified by:
addWatch in interface FAQServiceLegacy
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:
java.lang.Exception - the exception

addWatchCategory

public void addWatchCategory(java.lang.String id,
                             Watch watch)
                      throws java.lang.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:
java.lang.Exception - the exception

deleteMailInWatch

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

Specified by:
deleteMailInWatch in interface FAQServiceLegacy
Parameters:
categoryId - is id of current category
sProvider -
emails - is location current of one watch with user want delete
Throws:
java.lang.Exception - the exception

deleteCategoryWatch

public void deleteCategoryWatch(java.lang.String categoryId,
                                java.lang.String user)
                         throws java.lang.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:
java.lang.Exception - the exception

UnWatch

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

Specified by:
UnWatch in interface FAQServiceLegacy
Parameters:
categoryId - is id of current category
sProvider -
emails - is location current of one watch with user want delete
Throws:
java.lang.Exception - the exception

unWatchCategory

public void unWatchCategory(java.lang.String categoryId,
                            java.lang.String userCurrent)
                     throws java.lang.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:
java.lang.Exception - the exception

UnWatchQuestion

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

Specified by:
UnWatchQuestion in interface FAQServiceLegacy
Parameters:
categoryId - is id of current category
sProvider -
emails - is location current of one watch with user want delete
Throws:
java.lang.Exception - the exception

unWatchQuestion

public void unWatchQuestion(java.lang.String questionID,
                            java.lang.String userCurrent)
                     throws java.lang.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:
java.lang.Exception - the exception

getListCateIdByModerator

public java.util.List<java.lang.String> getListCateIdByModerator(java.lang.String user,
                                                                 org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                                          throws java.lang.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

Specified by:
getListCateIdByModerator in interface FAQServiceLegacy
Parameters:
user - is name when user login
sProvider -
Returns:
Category list
Throws:
java.lang.Exception - the exception

getListCateIdByModerator

public java.util.List<java.lang.String> getListCateIdByModerator(java.lang.String user)
                                                          throws java.lang.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:
java.lang.Exception - if can't found user

getSearchResults

public java.util.List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
                                                    throws java.lang.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:
java.lang.Exception - the exception

getCategoryPath

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

Specified by:
getCategoryPath in interface FAQServiceLegacy
Parameters:
category - identify
sProvider -
Returns:
list category name is sort(path of this category)
Throws:
java.lang.Exception - the exception

getCategoryPath

public java.util.List<java.lang.String> getCategoryPath(java.lang.String categoryId)
                                                 throws java.lang.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:
java.lang.Exception - the exception

sendMessage

public void sendMessage(org.exoplatform.services.mail.Message message)
                 throws java.lang.Exception
This function will send message to address but you want send

Specified by:
sendMessage in interface FAQService
Parameters:
message - is object save content with user want send to one or many address email
Throws:
java.lang.Exception - the exception

addLanguage

public void addLanguage(javax.jcr.Node questionNode,
                        QuestionLanguage language)
                 throws java.lang.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:
java.lang.Exception - throw an exception when save a new language node

getUserSetting

public void getUserSetting(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                           java.lang.String userName,
                           FAQSetting faqSetting)
                    throws java.lang.Exception
Specified by:
getUserSetting in interface FAQServiceLegacy
Throws:
java.lang.Exception

getUserSetting

public void getUserSetting(java.lang.String userName,
                           FAQSetting faqSetting)
                    throws java.lang.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:
java.lang.Exception - when can't find user or faqSetting

getMessageInfo

public NotifyInfo getMessageInfo(java.lang.String name)
                          throws java.lang.Exception
Specified by:
getMessageInfo in interface FAQService
Throws:
java.lang.Exception

isAdminRole

public boolean isAdminRole(java.lang.String userName,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws java.lang.Exception
Specified by:
isAdminRole in interface FAQServiceLegacy
Throws:
java.lang.Exception

isAdminRole

public boolean isAdminRole(java.lang.String userName)
                    throws java.lang.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 addmin and false if opposite
Throws:
java.lang.Exception

getCategoryNodeById

public javax.jcr.Node getCategoryNodeById(java.lang.String categoryId,
                                          org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                   throws java.lang.Exception
Specified by:
getCategoryNodeById in interface FAQServiceLegacy
Throws:
java.lang.Exception

getCategoryNodeById

public javax.jcr.Node getCategoryNodeById(java.lang.String categoryId)
                                   throws java.lang.Exception
Specified by:
getCategoryNodeById in interface FAQService
Throws:
java.lang.Exception

addWatchQuestion

public void addWatchQuestion(java.lang.String questionId,
                             Watch watch,
                             boolean isNew,
                             org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                      throws java.lang.Exception
Specified by:
addWatchQuestion in interface FAQServiceLegacy
Throws:
java.lang.Exception

addWatchQuestion

public void addWatchQuestion(java.lang.String questionId,
                             Watch watch,
                             boolean isNew)
                      throws java.lang.Exception
Specified by:
addWatchQuestion in interface FAQService
Throws:
java.lang.Exception

getListQuestionsWatch

public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                              java.lang.String currentUser,
                                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                       throws java.lang.Exception
Specified by:
getListQuestionsWatch in interface FAQServiceLegacy
Throws:
java.lang.Exception

getListQuestionsWatch

public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                              java.lang.String currentUser)
                                       throws java.lang.Exception
Specified by:
getListQuestionsWatch in interface FAQService
Throws:
java.lang.Exception

importData

public void importData(java.lang.String categoryId,
                       javax.jcr.Session session,
                       java.io.InputStream inputStream,
                       boolean isZip,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws java.lang.Exception
Specified by:
importData in interface FAQServiceLegacy
Throws:
java.lang.Exception

importData

public boolean importData(java.lang.String categoryId,
                          java.io.InputStream inputStream,
                          boolean isZip)
                   throws java.lang.Exception
Specified by:
importData in interface FAQService
Throws:
java.lang.Exception

exportData

public java.io.InputStream exportData(java.lang.String categoryId,
                                      boolean createZipFile)
                               throws java.lang.Exception
Specified by:
exportData in interface FAQService
Throws:
java.lang.Exception

swapCategories

public void swapCategories(java.lang.String parentCateId,
                           java.lang.String cateId1,
                           java.lang.String cateId2,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws java.lang.Exception
Specified by:
swapCategories in interface FAQServiceLegacy
Throws:
java.lang.Exception

swapCategories

public void swapCategories(java.lang.String cateId1,
                           java.lang.String cateId2)
                    throws java.lang.Exception
Specified by:
swapCategories in interface FAQService
Throws:
java.lang.Exception

saveTopicIdDiscussQuestion

public void saveTopicIdDiscussQuestion(java.lang.String questionId,
                                       java.lang.String pathDiscuss,
                                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                throws java.lang.Exception
Specified by:
saveTopicIdDiscussQuestion in interface FAQServiceLegacy
Throws:
java.lang.Exception

saveTopicIdDiscussQuestion

public void saveTopicIdDiscussQuestion(java.lang.String questionId,
                                       java.lang.String pathDiscuss)
                                throws java.lang.Exception
Specified by:
saveTopicIdDiscussQuestion in interface FAQService
Throws:
java.lang.Exception

getMaxindexCategory

public long getMaxindexCategory(java.lang.String parentId,
                                org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                         throws java.lang.Exception
Specified by:
getMaxindexCategory in interface FAQServiceLegacy
Throws:
java.lang.Exception

getMaxindexCategory

public long getMaxindexCategory(java.lang.String parentId)
                         throws java.lang.Exception
Specified by:
getMaxindexCategory in interface FAQService
Throws:
java.lang.Exception

deleteAnswer

public void deleteAnswer(java.lang.String questionId,
                         java.lang.String answerId,
                         org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                  throws java.lang.Exception
Specified by:
deleteAnswer in interface FAQServiceLegacy
Throws:
java.lang.Exception

deleteAnswer

public void deleteAnswer(java.lang.String questionId,
                         java.lang.String answerId)
                  throws java.lang.Exception
Specified by:
deleteAnswer in interface FAQService
Throws:
java.lang.Exception

deleteComment

public void deleteComment(java.lang.String questionId,
                          java.lang.String commentId,
                          org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                   throws java.lang.Exception
Specified by:
deleteComment in interface FAQServiceLegacy
Throws:
java.lang.Exception

deleteComment

public void deleteComment(java.lang.String questionId,
                          java.lang.String commentId)
                   throws java.lang.Exception
Specified by:
deleteComment in interface FAQService
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionId,
                       Answer answer,
                       boolean isNew,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQServiceLegacy
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionId,
                       Answer answer,
                       boolean isNew)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQService
Throws:
java.lang.Exception

saveComment

public void saveComment(java.lang.String questionId,
                        Comment comment,
                        boolean isNew,
                        org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                 throws java.lang.Exception
Specified by:
saveComment in interface FAQServiceLegacy
Throws:
java.lang.Exception

saveComment

public void saveComment(java.lang.String questionId,
                        Comment comment,
                        boolean isNew)
                 throws java.lang.Exception
Specified by:
saveComment in interface FAQService
Throws:
java.lang.Exception

getCommentById

public Comment getCommentById(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                              java.lang.String questionId,
                              java.lang.String commentId)
                       throws java.lang.Exception
Specified by:
getCommentById in interface FAQServiceLegacy
Throws:
java.lang.Exception

getCommentById

public Comment getCommentById(java.lang.String questionId,
                              java.lang.String commentId)
                       throws java.lang.Exception
Specified by:
getCommentById in interface FAQService
Throws:
java.lang.Exception

getAnswerById

public Answer getAnswerById(java.lang.String questionId,
                            java.lang.String answerid,
                            org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                     throws java.lang.Exception
Specified by:
getAnswerById in interface FAQServiceLegacy
Throws:
java.lang.Exception

getAnswerById

public Answer getAnswerById(java.lang.String questionId,
                            java.lang.String answerid)
                     throws java.lang.Exception
Specified by:
getAnswerById in interface FAQService
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionId,
                       Answer[] answers,
                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQServiceLegacy
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionId,
                       Answer[] answers)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQService
Throws:
java.lang.Exception

getPageListAnswer

public JCRPageList getPageListAnswer(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                     java.lang.String questionId,
                                     java.lang.Boolean isSortByVote)
                              throws java.lang.Exception
Specified by:
getPageListAnswer in interface FAQServiceLegacy
Throws:
java.lang.Exception

getPageListAnswer

public JCRPageList getPageListAnswer(java.lang.String questionId,
                                     java.lang.Boolean isSortByVote)
                              throws java.lang.Exception
Specified by:
getPageListAnswer in interface FAQService
Throws:
java.lang.Exception

getPageListComment

public JCRPageList getPageListComment(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                      java.lang.String questionId)
                               throws java.lang.Exception
Specified by:
getPageListComment in interface FAQServiceLegacy
Throws:
java.lang.Exception

getPageListComment

public JCRPageList getPageListComment(java.lang.String questionId)
                               throws java.lang.Exception
Specified by:
getPageListComment in interface FAQService
Throws:
java.lang.Exception

getListCategoriesWatch

public QuestionPageList getListCategoriesWatch(java.lang.String userId,
                                               org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                        throws java.lang.Exception
Specified by:
getListCategoriesWatch in interface FAQServiceLegacy
Throws:
java.lang.Exception

getWatchedCategoryByUser

public QuestionPageList getWatchedCategoryByUser(java.lang.String userId)
                                          throws java.lang.Exception
Specified by:
getWatchedCategoryByUser in interface FAQService
Throws:
java.lang.Exception

getUserAvatar

public FileAttachment getUserAvatar(java.lang.String userName,
                                    org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                             throws java.lang.Exception
Specified by:
getUserAvatar in interface FAQServiceLegacy
Throws:
java.lang.Exception

getUserAvatar

public FileAttachment getUserAvatar(java.lang.String userName)
                             throws java.lang.Exception
Specified by:
getUserAvatar in interface FAQService
Throws:
java.lang.Exception

saveUserAvatar

public void saveUserAvatar(java.lang.String userId,
                           FileAttachment fileAttachment,
                           org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                    throws java.lang.Exception
Specified by:
saveUserAvatar in interface FAQServiceLegacy
Throws:
java.lang.Exception

saveUserAvatar

public void saveUserAvatar(java.lang.String userId,
                           FileAttachment fileAttachment)
                    throws java.lang.Exception
Specified by:
saveUserAvatar in interface FAQService
Throws:
java.lang.Exception

setDefaultAvatar

public void setDefaultAvatar(java.lang.String userName,
                             org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                      throws java.lang.Exception
Specified by:
setDefaultAvatar in interface FAQServiceLegacy
Throws:
java.lang.Exception

setDefaultAvatar

public void setDefaultAvatar(java.lang.String userName)
                      throws java.lang.Exception
Specified by:
setDefaultAvatar in interface FAQService
Throws:
java.lang.Exception

getWatchByUser

public boolean getWatchByUser(java.lang.String userId,
                              java.lang.String cateId,
                              org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                       throws java.lang.Exception
Specified by:
getWatchByUser in interface FAQServiceLegacy
Throws:
java.lang.Exception

isUserWatched

public boolean isUserWatched(java.lang.String userId,
                             java.lang.String cateId)
Specified by:
isUserWatched in interface FAQService

getPendingQuestionsByCategory

public QuestionPageList getPendingQuestionsByCategory(java.lang.String categoryId,
                                                      org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                                      FAQSetting faqSetting)
                                               throws java.lang.Exception
Specified by:
getPendingQuestionsByCategory in interface FAQServiceLegacy
Throws:
java.lang.Exception

getPendingQuestionsByCategory

public QuestionPageList getPendingQuestionsByCategory(java.lang.String categoryId,
                                                      FAQSetting faqSetting)
                                               throws java.lang.Exception
Specified by:
getPendingQuestionsByCategory in interface FAQService
Throws:
java.lang.Exception

getQuestionsIterator

public javax.jcr.NodeIterator getQuestionsIterator(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                            throws java.lang.Exception
Specified by:
getQuestionsIterator in interface FAQServiceLegacy
Throws:
java.lang.Exception

getQuestionsIterator

public javax.jcr.NodeIterator getQuestionsIterator()
                                            throws java.lang.Exception
Specified by:
getQuestionsIterator in interface FAQService
Throws:
java.lang.Exception

isExisting

public boolean isExisting(java.lang.String path)
Specified by:
isExisting in interface FAQService

getCategoryPathOf

public java.lang.String getCategoryPathOf(java.lang.String id)
                                   throws java.lang.Exception
Specified by:
getCategoryPathOf in interface FAQService
Throws:
java.lang.Exception

getQuestionContents

public java.util.List<java.lang.String> getQuestionContents(java.util.List<java.lang.String> paths)
                                                     throws java.lang.Exception
Specified by:
getQuestionContents in interface FAQService
Throws:
java.lang.Exception

getQuestionNodeById

public javax.jcr.Node getQuestionNodeById(java.lang.String path)
                                   throws java.lang.Exception
Specified by:
getQuestionNodeById in interface FAQService
Throws:
java.lang.Exception

isModerateAnswer

public boolean isModerateAnswer(java.lang.String id)
                         throws java.lang.Exception
Specified by:
isModerateAnswer in interface FAQService
Throws:
java.lang.Exception

isModerateQuestion

public boolean isModerateQuestion(java.lang.String id)
                           throws java.lang.Exception
Specified by:
isModerateQuestion in interface FAQService
Throws:
java.lang.Exception

getParentCategoriesName

public java.lang.String getParentCategoriesName(java.lang.String path)
                                         throws java.lang.Exception
Specified by:
getParentCategoriesName in interface FAQService
Throws:
java.lang.Exception

getListMailInWatch

public QuestionPageList getListMailInWatch(java.lang.String categoryId)
                                    throws java.lang.Exception
Specified by:
getListMailInWatch in interface FAQService
Throws:
java.lang.Exception

isCategoryModerator

public boolean isCategoryModerator(java.lang.String categoryPath,
                                   java.lang.String user)
                            throws java.lang.Exception
Specified by:
isCategoryModerator in interface FAQService
Throws:
java.lang.Exception

addLanguage

public void addLanguage(java.lang.String questionPath,
                        QuestionLanguage language)
                 throws java.lang.Exception
Specified by:
addLanguage in interface FAQService
Throws:
java.lang.Exception

deleteAnswerQuestionLang

public void deleteAnswerQuestionLang(java.lang.String questionPath,
                                     java.lang.String answerId,
                                     java.lang.String language)
                              throws java.lang.Exception
Specified by:
deleteAnswerQuestionLang in interface FAQService
Throws:
java.lang.Exception

deleteCommentQuestionLang

public void deleteCommentQuestionLang(java.lang.String questionPath,
                                      java.lang.String commentId,
                                      java.lang.String language)
                               throws java.lang.Exception
Specified by:
deleteCommentQuestionLang in interface FAQService
Throws:
java.lang.Exception

getQuestionLanguageByLanguage

public QuestionLanguage getQuestionLanguageByLanguage(java.lang.String questionPath,
                                                      java.lang.String language)
                                               throws java.lang.Exception
Specified by:
getQuestionLanguageByLanguage in interface FAQService
Throws:
java.lang.Exception

getCommentById

public Comment getCommentById(java.lang.String questionPath,
                              java.lang.String commentId,
                              java.lang.String language)
                       throws java.lang.Exception
Specified by:
getCommentById in interface FAQService
Throws:
java.lang.Exception

getAnswerById

public Answer getAnswerById(java.lang.String questionPath,
                            java.lang.String answerid,
                            java.lang.String language)
                     throws java.lang.Exception
Specified by:
getAnswerById in interface FAQService
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionPath,
                       Answer answer,
                       java.lang.String language)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQService
Throws:
java.lang.Exception

saveAnswer

public void saveAnswer(java.lang.String questionPath,
                       QuestionLanguage questionLanguage)
                throws java.lang.Exception
Specified by:
saveAnswer in interface FAQService
Throws:
java.lang.Exception

saveComment

public void saveComment(java.lang.String questionPath,
                        Comment comment,
                        java.lang.String languge)
                 throws java.lang.Exception
Specified by:
saveComment in interface FAQService
Throws:
java.lang.Exception

removeLanguage

public void removeLanguage(java.lang.String questionPath,
                           java.util.List<java.lang.String> listLanguage)
Specified by:
removeLanguage in interface FAQService

voteAnswer

public void voteAnswer(java.lang.String answerPath,
                       java.lang.String userName,
                       boolean isUp)
                throws java.lang.Exception
Specified by:
voteAnswer in interface FAQService
Throws:
java.lang.Exception

voteQuestion

public void voteQuestion(java.lang.String questionPath,
                         java.lang.String userName,
                         int number)
                  throws java.lang.Exception
Specified by:
voteQuestion in interface FAQService
Throws:
java.lang.Exception

unVoteQuestion

public void unVoteQuestion(java.lang.String questionPath,
                           java.lang.String userName)
                    throws java.lang.Exception
Specified by:
unVoteQuestion in interface FAQService
Throws:
java.lang.Exception

getModeratorsOf

public java.lang.String[] getModeratorsOf(java.lang.String path)
                                   throws java.lang.Exception
Specified by:
getModeratorsOf in interface FAQService
Throws:
java.lang.Exception

isViewAuthorInfo

public boolean isViewAuthorInfo(java.lang.String id)
                         throws java.lang.Exception
Specified by:
isViewAuthorInfo in interface FAQService
Throws:
java.lang.Exception

existingCategories

public long existingCategories()
                        throws java.lang.Exception
Specified by:
existingCategories in interface FAQService
Throws:
java.lang.Exception

getCategoryNameOf

public java.lang.String getCategoryNameOf(java.lang.String categoryPath)
                                   throws java.lang.Exception
Specified by:
getCategoryNameOf in interface FAQService
Throws:
java.lang.Exception

getQuickQuestionsByListCatetory

public java.util.List<Question> getQuickQuestionsByListCatetory(java.util.List<java.lang.String> listCategoryId,
                                                                boolean isNotYetAnswer)
                                                         throws java.lang.Exception
Specified by:
getQuickQuestionsByListCatetory in interface FAQService
Throws:
java.lang.Exception

listingCategoryTree

public java.util.List<Cate> listingCategoryTree()
                                         throws java.lang.Exception
Specified by:
listingCategoryTree in interface FAQService
Throws:
java.lang.Exception

getWatchByCategory

public java.util.List<Watch> getWatchByCategory(java.lang.String categoryId)
                                         throws java.lang.Exception
Specified by:
getWatchByCategory in interface FAQService
Throws:
java.lang.Exception

hasWatch

public boolean hasWatch(java.lang.String categoryPath)
Specified by:
hasWatch in interface FAQService

getCategoryInfo

public CategoryInfo getCategoryInfo(java.lang.String categoryPath,
                                    java.util.List<java.lang.String> categoryIdScoped)
                             throws java.lang.Exception
Specified by:
getCategoryInfo in interface FAQService
Throws:
java.lang.Exception

getTemplate

public byte[] getTemplate()
                   throws java.lang.Exception
Specified by:
getTemplate in interface FAQService
Throws:
java.lang.Exception

saveTemplate

public void saveTemplate(java.lang.String str)
                  throws java.lang.Exception
Specified by:
saveTemplate in interface FAQService
Throws:
java.lang.Exception

updateQuestionRelatives

public void updateQuestionRelatives(java.lang.String questionPath,
                                    java.lang.String[] relatives)
                             throws java.lang.Exception
Specified by:
updateQuestionRelatives in interface FAQService
Throws:
java.lang.Exception

isCategoryExist

public boolean isCategoryExist(java.lang.String name,
                               java.lang.String path)
Specified by:
isCategoryExist in interface FAQService

saveBBCode

public void saveBBCode(java.util.List<BBCode> bbcodes)
                throws java.lang.Exception
Specified by:
saveBBCode in interface FAQService
Throws:
java.lang.Exception

getAllBBCode

public java.util.List<BBCode> getAllBBCode()
                                    throws java.lang.Exception
Specified by:
getAllBBCode in interface FAQService
Throws:
java.lang.Exception

getActiveBBCode

public java.util.List<java.lang.String> getActiveBBCode()
                                                 throws java.lang.Exception
Specified by:
getActiveBBCode in interface FAQService
Throws:
java.lang.Exception

getBBcode

public BBCode getBBcode(java.lang.String id)
                 throws java.lang.Exception
Specified by:
getBBcode in interface FAQService
Throws:
java.lang.Exception

removeBBCode

public void removeBBCode(java.lang.String bbcodeId)
                  throws java.lang.Exception
Specified by:
removeBBCode in interface FAQService
Throws:
java.lang.Exception


Copyright © 2011 eXo Platform SAS. All Rights Reserved.