org.exoplatform.faq.service.impl
Class JCRDataStorage

java.lang.Object
  extended by org.exoplatform.faq.service.impl.JCRDataStorage
All Implemented Interfaces:
DataStorage, FAQNodeTypes

public class JCRDataStorage
extends Object
implements DataStorage, FAQNodeTypes

Created by The eXo Platform SARL Author : Hung Nguyen Quang hung.nguyen@exoplatform.com Jul 10, 2007


Field Summary
protected  Map<String,String> serverConfig_
           
 
Fields inherited from interface org.exoplatform.faq.service.FAQNodeTypes
ASCENDING, AT, DESCENDING, EMPTY_STR, EXO_ACTIVATE_RESPONSES, EXO_ANSWER, EXO_ANSWER_HOME, EXO_ANSWER_PATH, EXO_APPROVE_RESPONSES, EXO_AUTHOR, EXO_CATEGORY_ID, EXO_COMMENT, EXO_COMMENT_BY, EXO_COMMENT_HOME, EXO_COMMENT_LANGUAGE, EXO_COMMENTS, EXO_CONTENT, EXO_CREATED_DATE, EXO_DATE_COMMENT, EXO_DATE_RESPONSE, EXO_DESCRIPTION, EXO_EMAIL, EXO_EMAIL_WATCHING, EXO_FAQ_ATTACHMENT, EXO_FAQ_CATEGORY, EXO_FAQ_CATEGORY_HOME, EXO_FAQ_HOME, EXO_FAQ_LANGUAGE, EXO_FAQ_QUESTION, EXO_FAQ_QUESTION_HOME, EXO_FAQ_R_S_S, EXO_FAQ_RESOURCE, EXO_FAQ_SETTING_HOME, EXO_FAQ_USER_SETTING, EXO_FAQ_USER_SETTING_HOME, EXO_FAQ_WATCHING, EXO_FILE_NAME, EXO_FULL_NAME, EXO_ID, EXO_INDEX, EXO_IS_ACTIVATED, EXO_IS_APPROVED, EXO_IS_MODERATE_ANSWERS, EXO_IS_MODERATE_QUESTIONS, EXO_IS_VIEW, EXO_LANGUAGE, EXO_LAST_ACTIVITY, EXO_LINK, EXO_MARK_VOTE, EXO_MARK_VOTES, EXO_MODERATORS, EXO_NAME, EXO_NAME_ATTACHS, EXO_NUMBER_OF_PUBLIC_ANSWERS, EXO_ORDE_BY, EXO_ORDE_TYPE, EXO_POST_ID, EXO_QUESTION_ID, EXO_QUESTION_LANGUAGE_HOME, EXO_QUESTION_PATH, EXO_RELATIVES, EXO_RESPONSE_BY, EXO_RESPONSE_LANGUAGE, EXO_RESPONSES, EXO_RSS_WATCHING, EXO_SORT_QUESTION_BY_VOTE, EXO_TEMPLATE_HOME, EXO_TITLE, EXO_TOPIC_ID_DISCUSS, EXO_USER_PRIVATE, EXO_USER_WATCHING, EXO_USERS_VOTE, EXO_USERS_VOTE_ANSWER, EXO_VIEW_AUTHOR_INFOR, JCR_CONTENT, JCR_DATA, JCR_LAST_MODIFIED, JCR_MIME_TYPE, JCR_ROOT, MIX_FAQ_SUB_CATEGORY, MIX_FAQI_1_8N, NT_FILE, NT_RESOURCE, TEXT_HTML
 
Constructor Summary
JCRDataStorage(org.exoplatform.forum.common.jcr.KSDataLocation dataLocator)
           
 
Method Summary
 void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
           
 void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
           
 void addWatchCategory(String id, Watch watch)
           
 void addWatchQuestion(String questionId, Watch watch, boolean isNew)
           
protected  javax.jcr.Value[] booleanToValues(javax.jcr.Node node, Boolean[] bools)
           
 void calculateDeletedUser(String userName)
           
 void changeStatusCategoryView(List<String> listCateIds)
           
 InputStream createAnswerRSS(String cateId)
           
 void deleteAnswer(String questionId, String answerId)
           
 void deleteCategoryWatch(String categoryId, String user)
           
 void deleteComment(String questionId, String commentId)
           
 long existingCategories()
           
 InputStream exportData(String categoryId, boolean createZipFile)
           
 List<Category> findCategoriesByName(String categoryName)
           
 List<Category> getAllCategories()
           
 List<String> getAllFAQAdmin()
           
 QuestionPageList getAllQuestions()
           
 QuestionPageList getAllQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
           
 Answer getAnswerById(String questionId, String answerid)
           
 Category getCategoryById(String categoryId)
           
 long[] getCategoryInfo(String categoryId, FAQSetting faqSetting)
           
 CategoryInfo getCategoryInfo(String categoryPath, List<String> categoryIdScoped)
           
 String getCategoryNameOf(String categoryPath)
           
 javax.jcr.Node getCategoryNodeById(String categoryId)
           
 List<String> getCategoryPath(String categoryId)
           
 String getCategoryPathOf(String id)
           
 String getCategoryPathOfQuestion(String questionPath)
           
 Comment getCommentById(javax.jcr.Node questionNode, String commentId)
           
 Comment getCommentById(String questionId, String commentId)
           
 Comment[] getComments(String questionId)
           
protected  javax.jcr.Node getFAQServiceHome(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
static List<FileAttachment> getFileAttachments(javax.jcr.Node node)
           
 List<String> getListCateIdByModerator(String user)
           
 QuestionPageList getListMailInWatch(String categoryId)
           
 QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, String currentUser)
           
 long getMaxindexCategory(String parentId)
           
 org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
           
 String[] getModeratorsOf(String path)
           
 JCRPageList getPageListAnswer(String questionId, boolean isSortByVote)
           
 JCRPageList getPageListComment(String questionId)
           
 String getParentCategoriesName(String path)
           
 Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
           
 QuestionPageList getPendingQuestionsByCategory(String categoryId, FAQSetting faqSetting)
           
 Question getQuestionById(String questionId)
           
 List<String> getQuestionContents(List<String> paths)
           
 List<QuestionLanguage> getQuestionLanguages(String questionId)
           
 javax.jcr.Node getQuestionNodeById(String path)
           
 QuestionPageList getQuestionsByCatetory(String categoryId, FAQSetting faqSetting)
           
 QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer)
           
 javax.jcr.NodeIterator getQuestionsIterator(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 QuestionPageList getQuestionsNotYetAnswer(String categoryId, boolean isApproved)
           
 List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer)
           
 Map<String,String> getRelationQuestion(List<String> paths)
          Get a map which contains id as questionID and value as question's title
 List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
           
 List<Category> getSubCategories(String categoryId, FAQSetting faqSetting, boolean isGetAll, List<String> limitedUsers)
           
 byte[] getTemplate()
           
 List<ObjectSearchResult> getUnifiedSearchResults(FAQEventQuery eventQuery)
           
 FileAttachment getUserAvatar(String userName)
           
 void getUserSetting(String userName, FAQSetting faqSetting)
           
 List<Watch> getWatchByCategory(String categoryId)
           
 List<Watch> getWatchByQuestion(String questionId)
           
 QuestionPageList getWatchedCategoryByUser(String userId)
           
 List<String> getWatchedSubCategory(String userId, String cateId)
           
 boolean hasWatch(String categoryPath)
           
 boolean importData(String parentId, InputStream inputStream, boolean isZip)
           
 boolean initRootCategory()
           
 boolean isAdminRole(String userName)
           
 boolean isCategoryExist(String name, String path)
           
 boolean isCategoryModerator(String categoryId, String user)
           
 boolean isExisting(String path)
           
 boolean isModerateAnswer(String id)
           
 boolean isModerateQuestion(String id)
           
 boolean isUserWatched(String userId, String cateId)
           
 boolean isViewAuthorInfo(String id)
           
 List<Cate> listingCategoryTree()
           
protected static void logDebug(String message)
           
 void moveCategory(String categoryId, String destCategoryId)
           
 void moveQuestions(List<String> questions, String destCategoryId, String questionLink, FAQSetting faqSetting)
           
 Object readCategoryProperty(String categoryId, String propertyName, Class returnType)
          read property of the category by its name
 Object readQuestionProperty(String questionId, String propertyName, Class returnType)
           
 void reCalculateInfoOfQuestion(String absPathOfProp)
           
 void reInitQuestionNodeListeners()
           
 void removeCategory(String categoryId)
           
 void removeQuestion(String questionId)
           
 void saveAnswer(String questionId, Answer[] answers)
           
 void saveAnswer(String questionId, Answer answer, boolean isNew)
           
 void saveAnswerQuestionLang(String questionId, Answer answer, String language, boolean isNew)
           
 void saveCategory(String parentId, Category cat, boolean isAddNew)
           
 void saveComment(String questionId, Comment comment, boolean isNew)
           
 void saveFAQSetting(FAQSetting faqSetting, String userName)
           
 javax.jcr.Node saveQuestion(Question question, boolean isAddNew, FAQSetting faqSetting)
           
 void saveTemplate(String str)
           
 void saveTopicIdDiscussQuestion(String questionId, String topicId)
           
 void saveUserAvatar(String userId, FileAttachment fileAttachment)
           
 void setDefaultAvatar(String userName)
           
 void swapCategories(String cateId1, String cateId2)
           
 void unWatchCategory(String categoryId, String user)
           
 void unWatchQuestion(String questionId, String user)
           
 void updateQuestionRelatives(String questionPath, String[] relatives)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverConfig_

protected Map<String,String> serverConfig_
Constructor Detail

JCRDataStorage

public JCRDataStorage(org.exoplatform.forum.common.jcr.KSDataLocation dataLocator)
               throws Exception
Throws:
Exception
Method Detail

addPlugin

public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
               throws Exception
Specified by:
addPlugin in interface DataStorage
Throws:
Exception

addRolePlugin

public void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                   throws Exception
Specified by:
addRolePlugin in interface DataStorage
Throws:
Exception

isAdminRole

public boolean isAdminRole(String userName)
                    throws Exception
Specified by:
isAdminRole in interface DataStorage
Parameters:
userName - userName
Returns:
true if userName has admin role. The current user is implied if userName is null.
Throws:
Exception

getAllFAQAdmin

public List<String> getAllFAQAdmin()
                            throws Exception
Specified by:
getAllFAQAdmin in interface DataStorage
Throws:
Exception

getUserSetting

public void getUserSetting(String userName,
                           FAQSetting faqSetting)
                    throws Exception
Specified by:
getUserSetting in interface DataStorage
Throws:
Exception

saveFAQSetting

public void saveFAQSetting(FAQSetting faqSetting,
                           String userName)
                    throws Exception
Specified by:
saveFAQSetting in interface DataStorage
Throws:
Exception

getUserAvatar

public FileAttachment getUserAvatar(String userName)
                             throws Exception
Specified by:
getUserAvatar in interface DataStorage
Throws:
Exception

saveUserAvatar

public void saveUserAvatar(String userId,
                           FileAttachment fileAttachment)
                    throws Exception
Specified by:
saveUserAvatar in interface DataStorage
Throws:
Exception

setDefaultAvatar

public void setDefaultAvatar(String userName)
                      throws Exception
Specified by:
setDefaultAvatar in interface DataStorage
Throws:
Exception

getQuestionsIterator

public javax.jcr.NodeIterator getQuestionsIterator(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                            throws Exception
Throws:
Exception

reInitQuestionNodeListeners

public void reInitQuestionNodeListeners()
                                 throws Exception
Throws:
Exception

initRootCategory

public boolean initRootCategory()
                         throws Exception
Specified by:
initRootCategory in interface DataStorage
Throws:
Exception

getTemplate

public byte[] getTemplate()
                   throws Exception
Specified by:
getTemplate in interface DataStorage
Throws:
Exception

saveTemplate

public void saveTemplate(String str)
                  throws Exception
Specified by:
saveTemplate in interface DataStorage
Throws:
Exception

booleanToValues

protected javax.jcr.Value[] booleanToValues(javax.jcr.Node node,
                                            Boolean[] bools)
                                     throws Exception
Throws:
Exception

getQuestionLanguages

public List<QuestionLanguage> getQuestionLanguages(String questionId)
Specified by:
getQuestionLanguages in interface DataStorage

deleteAnswer

public void deleteAnswer(String questionId,
                         String answerId)
                  throws Exception
Specified by:
deleteAnswer in interface DataStorage
Throws:
Exception

deleteComment

public void deleteComment(String questionId,
                          String commentId)
                   throws Exception
Specified by:
deleteComment in interface DataStorage
Throws:
Exception

getPageListAnswer

public JCRPageList getPageListAnswer(String questionId,
                                     boolean isSortByVote)
                              throws Exception
Specified by:
getPageListAnswer in interface DataStorage
Throws:
Exception

saveAnswer

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

saveAnswer

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

saveComment

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

saveAnswerQuestionLang

public void saveAnswerQuestionLang(String questionId,
                                   Answer answer,
                                   String language,
                                   boolean isNew)
                            throws Exception
Specified by:
saveAnswerQuestionLang in interface DataStorage
Throws:
Exception

getAnswerById

public Answer getAnswerById(String questionId,
                            String answerid)
                     throws Exception
Specified by:
getAnswerById in interface DataStorage
Throws:
Exception

getPageListComment

public JCRPageList getPageListComment(String questionId)
                               throws Exception
Specified by:
getPageListComment in interface DataStorage
Throws:
Exception

getCommentById

public Comment getCommentById(String questionId,
                              String commentId)
                       throws Exception
Specified by:
getCommentById in interface DataStorage
Throws:
Exception

saveQuestion

public javax.jcr.Node saveQuestion(Question question,
                                   boolean isAddNew,
                                   FAQSetting faqSetting)
                            throws Exception
Specified by:
saveQuestion in interface DataStorage
Throws:
Exception

removeQuestion

public void removeQuestion(String questionId)
                    throws Exception
Specified by:
removeQuestion in interface DataStorage
Throws:
Exception

getCommentById

public Comment getCommentById(javax.jcr.Node questionNode,
                              String commentId)
                       throws Exception
Specified by:
getCommentById in interface DataStorage
Throws:
Exception

getFileAttachments

public static List<FileAttachment> getFileAttachments(javax.jcr.Node node)
                                               throws Exception
Throws:
Exception

getQuestionById

public Question getQuestionById(String questionId)
                         throws Exception
Specified by:
getQuestionById in interface DataStorage
Throws:
Exception

getAllQuestions

public QuestionPageList getAllQuestions()
                                 throws Exception
Specified by:
getAllQuestions in interface DataStorage
Throws:
Exception

getQuestionsNotYetAnswer

public QuestionPageList getQuestionsNotYetAnswer(String categoryId,
                                                 boolean isApproved)
                                          throws Exception
Specified by:
getQuestionsNotYetAnswer in interface DataStorage
Throws:
Exception

getPendingQuestionsByCategory

public QuestionPageList getPendingQuestionsByCategory(String categoryId,
                                                      FAQSetting faqSetting)
                                               throws Exception
Specified by:
getPendingQuestionsByCategory in interface DataStorage
Throws:
Exception

getQuestionsByCatetory

public QuestionPageList getQuestionsByCatetory(String categoryId,
                                               FAQSetting faqSetting)
                                        throws Exception
Specified by:
getQuestionsByCatetory in interface DataStorage
Throws:
Exception

getAllQuestionsByCatetory

public QuestionPageList getAllQuestionsByCatetory(String categoryId,
                                                  FAQSetting faqSetting)
                                           throws Exception
Specified by:
getAllQuestionsByCatetory in interface DataStorage
Throws:
Exception

getQuestionsByListCatetory

public QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId,
                                                   boolean isNotYetAnswer)
                                            throws Exception
Specified by:
getQuestionsByListCatetory in interface DataStorage
Throws:
Exception

getQuickQuestionsByListCatetory

public List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId,
                                                      boolean isNotYetAnswer)
                                               throws Exception
Specified by:
getQuickQuestionsByListCatetory in interface DataStorage
Throws:
Exception

getCategoryPathOfQuestion

public String getCategoryPathOfQuestion(String questionPath)
                                 throws Exception
Specified by:
getCategoryPathOfQuestion in interface DataStorage
Throws:
Exception

moveQuestions

public void moveQuestions(List<String> questions,
                          String destCategoryId,
                          String questionLink,
                          FAQSetting faqSetting)
                   throws Exception
Specified by:
moveQuestions in interface DataStorage
Throws:
Exception

changeStatusCategoryView

public void changeStatusCategoryView(List<String> listCateIds)
                              throws Exception
Specified by:
changeStatusCategoryView in interface DataStorage
Throws:
Exception

getMaxindexCategory

public long getMaxindexCategory(String parentId)
                         throws Exception
Specified by:
getMaxindexCategory in interface DataStorage
Throws:
Exception

saveCategory

public void saveCategory(String parentId,
                         Category cat,
                         boolean isAddNew)
Specified by:
saveCategory in interface DataStorage

listingCategoryTree

public List<Cate> listingCategoryTree()
                               throws Exception
Specified by:
listingCategoryTree in interface DataStorage
Throws:
Exception

removeCategory

public void removeCategory(String categoryId)
                    throws Exception
Specified by:
removeCategory in interface DataStorage
Throws:
Exception

getCategoryById

public Category getCategoryById(String categoryId)
                         throws Exception
Specified by:
getCategoryById in interface DataStorage
Parameters:
categoryId - the path of the category starting from home. It should be in the form of "categories/CategoryXXX/CategoryXXX"
Returns:
Throws:
Exception

findCategoriesByName

public List<Category> findCategoriesByName(String categoryName)
                                    throws Exception
Specified by:
findCategoriesByName in interface DataStorage
Throws:
Exception

getListCateIdByModerator

public List<String> getListCateIdByModerator(String user)
                                      throws Exception
Specified by:
getListCateIdByModerator in interface DataStorage
Throws:
Exception

getAllCategories

public List<Category> getAllCategories()
                                throws Exception
Specified by:
getAllCategories in interface DataStorage
Throws:
Exception

readQuestionProperty

public Object readQuestionProperty(String questionId,
                                   String propertyName,
                                   Class returnType)
                            throws Exception
Throws:
Exception

readCategoryProperty

public Object readCategoryProperty(String categoryId,
                                   String propertyName,
                                   Class returnType)
                            throws Exception
read property of the category by its name

Parameters:
categoryId - id of the category
propertyName - name of the property
returnValue - expected return-type. The supported class types are String[], String, Long, Boolean, Double and Date.
Returns:
Throws:
Exception

existingCategories

public long existingCategories()
                        throws Exception
Specified by:
existingCategories in interface DataStorage
Throws:
Exception

getCategoryNodeById

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

getSubCategories

public List<Category> getSubCategories(String categoryId,
                                       FAQSetting faqSetting,
                                       boolean isGetAll,
                                       List<String> limitedUsers)
                                throws Exception
Specified by:
getSubCategories in interface DataStorage
Throws:
Exception

getCategoryInfo

public long[] getCategoryInfo(String categoryId,
                              FAQSetting faqSetting)
                       throws Exception
Specified by:
getCategoryInfo in interface DataStorage
Throws:
Exception

moveCategory

public void moveCategory(String categoryId,
                         String destCategoryId)
                  throws Exception
Specified by:
moveCategory in interface DataStorage
Throws:
Exception

addWatchCategory

public void addWatchCategory(String id,
                             Watch watch)
                      throws Exception
Specified by:
addWatchCategory in interface DataStorage
Throws:
Exception

getListMailInWatch

public QuestionPageList getListMailInWatch(String categoryId)
                                    throws Exception
Specified by:
getListMailInWatch in interface DataStorage
Throws:
Exception

getWatchByCategory

public List<Watch> getWatchByCategory(String categoryId)
                               throws Exception
Specified by:
getWatchByCategory in interface DataStorage
Throws:
Exception

hasWatch

public boolean hasWatch(String categoryPath)
Specified by:
hasWatch in interface DataStorage

addWatchQuestion

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

getWatchByQuestion

public List<Watch> getWatchByQuestion(String questionId)
                               throws Exception
Specified by:
getWatchByQuestion in interface DataStorage
Throws:
Exception

getWatchedCategoryByUser

public QuestionPageList getWatchedCategoryByUser(String userId)
                                          throws Exception
Specified by:
getWatchedCategoryByUser in interface DataStorage
Throws:
Exception

isUserWatched

public boolean isUserWatched(String userId,
                             String cateId)
Specified by:
isUserWatched in interface DataStorage

getWatchedSubCategory

public List<String> getWatchedSubCategory(String userId,
                                          String cateId)
                                   throws Exception
Specified by:
getWatchedSubCategory in interface DataStorage
Throws:
Exception

getListQuestionsWatch

public QuestionPageList getListQuestionsWatch(FAQSetting faqSetting,
                                              String currentUser)
                                       throws Exception
Specified by:
getListQuestionsWatch in interface DataStorage
Throws:
Exception

deleteCategoryWatch

public void deleteCategoryWatch(String categoryId,
                                String user)
                         throws Exception
Specified by:
deleteCategoryWatch in interface DataStorage
Throws:
Exception

unWatchCategory

public void unWatchCategory(String categoryId,
                            String user)
                     throws Exception
Specified by:
unWatchCategory in interface DataStorage
Throws:
Exception

unWatchQuestion

public void unWatchQuestion(String questionId,
                            String user)
                     throws Exception
Specified by:
unWatchQuestion in interface DataStorage
Throws:
Exception

getSearchResults

public List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery)
                                          throws Exception
Specified by:
getSearchResults in interface DataStorage
Throws:
Exception

getUnifiedSearchResults

public List<ObjectSearchResult> getUnifiedSearchResults(FAQEventQuery eventQuery)
                                                 throws Exception
Throws:
Exception

getCategoryPath

public List<String> getCategoryPath(String categoryId)
                             throws Exception
Specified by:
getCategoryPath in interface DataStorage
Throws:
Exception

getParentCategoriesName

public String getParentCategoriesName(String path)
                               throws Exception
Specified by:
getParentCategoriesName in interface DataStorage
Throws:
Exception

getPendingMessages

public Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
Specified by:
getPendingMessages in interface DataStorage

getMessageInfo

public org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name)
                                                       throws Exception
Specified by:
getMessageInfo in interface DataStorage
Throws:
Exception

swapCategories

public void swapCategories(String cateId1,
                           String cateId2)
                    throws Exception
Specified by:
swapCategories in interface DataStorage
Throws:
Exception

saveTopicIdDiscussQuestion

public void saveTopicIdDiscussQuestion(String questionId,
                                       String topicId)
                                throws Exception
Specified by:
saveTopicIdDiscussQuestion in interface DataStorage
Throws:
Exception

exportData

public InputStream exportData(String categoryId,
                              boolean createZipFile)
                       throws Exception
Specified by:
exportData in interface DataStorage
Throws:
Exception

importData

public boolean importData(String parentId,
                          InputStream inputStream,
                          boolean isZip)
                   throws Exception
Specified by:
importData in interface DataStorage
Throws:
Exception

isExisting

public boolean isExisting(String path)
                   throws Exception
Specified by:
isExisting in interface DataStorage
Throws:
Exception

getCategoryPathOf

public String getCategoryPathOf(String id)
                         throws Exception
Specified by:
getCategoryPathOf in interface DataStorage
Throws:
Exception

isModerateAnswer

public boolean isModerateAnswer(String id)
Specified by:
isModerateAnswer in interface DataStorage

isModerateQuestion

public boolean isModerateQuestion(String id)
Specified by:
isModerateQuestion in interface DataStorage

isViewAuthorInfo

public boolean isViewAuthorInfo(String id)
Specified by:
isViewAuthorInfo in interface DataStorage

isCategoryModerator

public boolean isCategoryModerator(String categoryId,
                                   String user)
                            throws Exception
Specified by:
isCategoryModerator in interface DataStorage
Parameters:
categoryId - id of category
user - username
Returns:
true if user is moderator of the category. The current user is implied if user is null.
Throws:
Exception

isCategoryExist

public boolean isCategoryExist(String name,
                               String path)
Specified by:
isCategoryExist in interface DataStorage

getQuestionContents

public List<String> getQuestionContents(List<String> paths)
                                 throws Exception
Specified by:
getQuestionContents in interface DataStorage
Throws:
Exception

getRelationQuestion

public Map<String,String> getRelationQuestion(List<String> paths)
                                       throws Exception
Get a map which contains id as questionID and value as question's title

Parameters:
paths -
Returns:
a map which has key: questionID and value: question title
Throws:
Exception

getQuestionNodeById

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

getModeratorsOf

public String[] getModeratorsOf(String path)
                         throws Exception
Specified by:
getModeratorsOf in interface DataStorage
Throws:
Exception

getCategoryNameOf

public String getCategoryNameOf(String categoryPath)
                         throws Exception
Specified by:
getCategoryNameOf in interface DataStorage
Throws:
Exception

getCategoryInfo

public CategoryInfo getCategoryInfo(String categoryPath,
                                    List<String> categoryIdScoped)
                             throws Exception
Specified by:
getCategoryInfo in interface DataStorage
Throws:
Exception

reCalculateInfoOfQuestion

public void reCalculateInfoOfQuestion(String absPathOfProp)
                               throws Exception
Throws:
Exception

updateQuestionRelatives

public void updateQuestionRelatives(String questionPath,
                                    String[] relatives)
                             throws Exception
Specified by:
updateQuestionRelatives in interface DataStorage
Throws:
Exception

calculateDeletedUser

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

createAnswerRSS

public InputStream createAnswerRSS(String cateId)
                            throws Exception
Throws:
Exception

getComments

public Comment[] getComments(String questionId)
                      throws Exception
Throws:
Exception

getFAQServiceHome

protected javax.jcr.Node getFAQServiceHome(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                    throws Exception
Throws:
Exception

logDebug

protected static void logDebug(String message)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.