public class JCRDataStorage extends Object implements DataStorage, FAQNodeTypes
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
serverConfig_ |
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, JCR_SCORE, MIX_FAQ_SUB_CATEGORY, MIX_FAQI_1_8N, NT_FILE, NT_RESOURCE, REP_EXCERPT, REP_EXCERPT_PATTERN, TEXT_HTML| Constructor and Description |
|---|
JCRDataStorage(org.exoplatform.forum.common.jcr.KSDataLocation dataLocator) |
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
addPlugin in interface DataStorageExceptionpublic void addRolePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
throws Exception
addRolePlugin in interface DataStorageExceptionpublic boolean isAdminRole(String userName) throws Exception
isAdminRole in interface DataStorageuserName - userNameExceptionpublic List<String> getAllFAQAdmin() throws Exception
getAllFAQAdmin in interface DataStorageExceptionpublic void getUserSetting(String userName, FAQSetting faqSetting) throws Exception
getUserSetting in interface DataStorageExceptionpublic void saveFAQSetting(FAQSetting faqSetting, String userName) throws Exception
saveFAQSetting in interface DataStorageExceptionpublic FileAttachment getUserAvatar(String userName) throws Exception
getUserAvatar in interface DataStorageExceptionpublic void saveUserAvatar(String userId, FileAttachment fileAttachment) throws Exception
saveUserAvatar in interface DataStorageExceptionpublic void setDefaultAvatar(String userName) throws Exception
setDefaultAvatar in interface DataStorageExceptionpublic javax.jcr.NodeIterator getQuestionsIterator(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exceptionpublic void initQuestionNodeListeners()
throws Exception
Exceptionpublic boolean initRootCategory()
throws Exception
initRootCategory in interface DataStorageExceptionpublic byte[] getTemplate()
throws Exception
getTemplate in interface DataStorageExceptionpublic void saveTemplate(String str) throws Exception
saveTemplate in interface DataStorageExceptionprotected javax.jcr.Value[] booleanToValues(javax.jcr.Node node,
Boolean[] bools)
throws Exception
Exceptionpublic List<QuestionLanguage> getQuestionLanguages(String questionId)
getQuestionLanguages in interface DataStoragepublic void deleteAnswer(String questionId, String answerId) throws Exception
deleteAnswer in interface DataStorageExceptionpublic void deleteComment(String questionId, String commentId) throws Exception
deleteComment in interface DataStorageExceptionpublic JCRPageList getPageListAnswer(String questionId, boolean isSortByVote) throws Exception
getPageListAnswer in interface DataStorageExceptionpublic void saveAnswer(String questionId, Answer answer, boolean isNew) throws Exception
saveAnswer in interface DataStorageExceptionpublic void saveAnswer(String questionId, Answer[] answers, FAQSetting faqSetting) throws Exception
saveAnswer in interface DataStorageExceptionpublic void saveComment(String questionId, Comment comment, boolean isNew) throws Exception
saveComment in interface DataStorageExceptionpublic void saveAnswerQuestionLang(String questionId, Answer answer, String language, boolean isNew) throws Exception
saveAnswerQuestionLang in interface DataStorageExceptionpublic Answer getAnswerById(String questionId, String answerid) throws Exception
getAnswerById in interface DataStorageExceptionpublic JCRPageList getPageListComment(String questionId) throws Exception
getPageListComment in interface DataStorageExceptionpublic Comment getCommentById(String questionId, String commentId) throws Exception
getCommentById in interface DataStorageExceptionpublic javax.jcr.Node saveQuestion(Question question, boolean isAddNew, FAQSetting faqSetting) throws Exception
saveQuestion in interface DataStorageExceptionpublic void removeQuestion(String questionId) throws Exception
removeQuestion in interface DataStorageExceptionpublic Comment getCommentById(javax.jcr.Node questionNode, String commentId) throws Exception
getCommentById in interface DataStorageExceptionpublic static List<FileAttachment> getFileAttachments(javax.jcr.Node node) throws Exception
Exceptionpublic Question getQuestionById(String questionId) throws Exception
getQuestionById in interface DataStorageExceptionpublic QuestionPageList getAllQuestions() throws Exception
getAllQuestions in interface DataStorageExceptionpublic QuestionPageList getQuestionsNotYetAnswer(String categoryId, boolean isApproved) throws Exception
getQuestionsNotYetAnswer in interface DataStorageExceptionpublic QuestionPageList getPendingQuestionsByCategory(String categoryId, FAQSetting faqSetting) throws Exception
getPendingQuestionsByCategory in interface DataStorageExceptionpublic QuestionPageList getQuestionsByCatetory(String categoryId, FAQSetting faqSetting) throws Exception
getQuestionsByCatetory in interface DataStorageExceptionpublic QuestionPageList getAllQuestionsByCatetory(String categoryId, FAQSetting faqSetting) throws Exception
getAllQuestionsByCatetory in interface DataStorageExceptionpublic List<String> getAllActivityIdsByCatetory(String categoryId) throws Exception
getAllActivityIdsByCatetory in interface DataStorageExceptionpublic QuestionPageList getQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer) throws Exception
getQuestionsByListCatetory in interface DataStorageExceptionpublic List<Question> getQuickQuestionsByListCatetory(List<String> listCategoryId, boolean isNotYetAnswer) throws Exception
getQuickQuestionsByListCatetory in interface DataStorageExceptionpublic String getCategoryPathOfQuestion(String questionPath) throws Exception
getCategoryPathOfQuestion in interface DataStorageExceptionpublic void moveQuestions(List<String> questions, String destCategoryId, String questionLink, FAQSetting faqSetting) throws Exception
moveQuestions in interface DataStorageExceptionpublic void changeStatusCategoryView(List<String> listCateIds) throws Exception
changeStatusCategoryView in interface DataStorageExceptionpublic long getMaxindexCategory(String parentId) throws Exception
getMaxindexCategory in interface DataStorageExceptionpublic void saveCategory(String parentId, Category cat, boolean isAddNew)
saveCategory in interface DataStoragepublic void saveCategory(String parentId, Category cat, boolean isAddNew, boolean isResetIndex)
saveCategory in interface DataStoragepublic List<Cate> listingCategoryTree() throws Exception
listingCategoryTree in interface DataStorageExceptionpublic CategoryTree buildCategoryTree(String categoryId) throws Exception
buildCategoryTree in interface DataStorageExceptionpublic void removeCategory(String categoryId) throws Exception
removeCategory in interface DataStorageExceptionpublic Category getCategoryById(String categoryId) throws Exception
getCategoryById in interface DataStoragecategoryId - the path of the category starting from home. It should be in the form of "categories/CategoryXXX/CategoryXXX"Exceptionpublic List<Category> findCategoriesByName(String categoryName) throws Exception
findCategoriesByName in interface DataStorageExceptionpublic List<String> getListCateIdByModerator(String user) throws Exception
getListCateIdByModerator in interface DataStorageExceptionpublic List<Category> getAllCategories() throws Exception
getAllCategories in interface DataStorageExceptionpublic Object readQuestionProperty(String questionId, String propertyName, Class returnType) throws Exception
Exceptionpublic Object readCategoryProperty(String categoryId, String propertyName, Class returnType) throws Exception
categoryId - id of the categorypropertyName - name of the propertyreturnType - expected return-type. The supported class types are String[], String, Long, Boolean, Double and Date.Exceptionpublic long existingCategories()
throws Exception
existingCategories in interface DataStorageExceptionpublic javax.jcr.Node getCategoryNodeById(String categoryId) throws Exception
getCategoryNodeById in interface DataStorageExceptionpublic List<Category> getSubCategories(String categoryPath, FAQSetting faqSetting, List<String> limitedUsers) throws Exception
getSubCategories in interface DataStorageExceptionpublic long[] getCategoryInfo(String categoryId, FAQSetting faqSetting) throws Exception
getCategoryInfo in interface DataStorageExceptionpublic void moveCategory(String categoryId, String destCategoryId) throws Exception
moveCategory in interface DataStorageExceptionpublic void addWatchCategory(String id, Watch watch) throws Exception
addWatchCategory in interface DataStorageExceptionpublic QuestionPageList getListMailInWatch(String categoryId) throws Exception
getListMailInWatch in interface DataStorageExceptionpublic List<Watch> getWatchByCategory(String categoryId) throws Exception
getWatchByCategory in interface DataStorageExceptionpublic boolean hasWatch(String categoryPath)
hasWatch in interface DataStoragepublic void addWatchQuestion(String questionId, Watch watch, boolean isNew) throws Exception
addWatchQuestion in interface DataStorageExceptionpublic List<Watch> getWatchByQuestion(String questionId) throws Exception
getWatchByQuestion in interface DataStorageExceptionpublic QuestionPageList getWatchedCategoryByUser(String userId) throws Exception
getWatchedCategoryByUser in interface DataStorageExceptionpublic boolean isUserWatched(String userId, String cateId)
isUserWatched in interface DataStoragepublic List<String> getWatchedSubCategory(String userId, String cateId) throws Exception
getWatchedSubCategory in interface DataStorageExceptionpublic QuestionPageList getListQuestionsWatch(FAQSetting faqSetting, String currentUser) throws Exception
getListQuestionsWatch in interface DataStorageExceptionpublic void deleteCategoryWatch(String categoryId, String user) throws Exception
deleteCategoryWatch in interface DataStorageExceptionpublic void unWatchCategory(String categoryId, String user) throws Exception
unWatchCategory in interface DataStorageExceptionpublic void unWatchQuestion(String questionId, String user) throws Exception
unWatchQuestion in interface DataStorageExceptionpublic List<ObjectSearchResult> getSearchResults(FAQEventQuery eventQuery) throws Exception
getSearchResults in interface DataStorageExceptionpublic List<ObjectSearchResult> getUnifiedSearchResults(FAQEventQuery eventQuery) throws Exception
Exceptionpublic List<String> getCategoryPath(String categoryId) throws Exception
getCategoryPath in interface DataStorageExceptionpublic String getParentCategoriesName(String path) throws Exception
getParentCategoriesName in interface DataStorageExceptionpublic Iterator<org.exoplatform.forum.common.NotifyInfo> getPendingMessages()
getPendingMessages in interface DataStoragepublic org.exoplatform.forum.common.NotifyInfo getMessageInfo(String name) throws Exception
getMessageInfo in interface DataStorageExceptionpublic void swapCategories(String cateId1, String cateId2) throws Exception
swapCategories in interface DataStorageExceptionpublic void saveTopicIdDiscussQuestion(String questionId, String topicId) throws Exception
saveTopicIdDiscussQuestion in interface DataStorageExceptionpublic InputStream exportData(String categoryId, boolean createZipFile) throws Exception
exportData in interface DataStorageExceptionpublic boolean importData(String parentId, InputStream inputStream, boolean isZip) throws Exception
importData in interface DataStorageExceptionpublic boolean isExisting(String path) throws Exception
isExisting in interface DataStorageExceptionpublic String getCategoryPathOf(String id) throws Exception
getCategoryPathOf in interface DataStorageExceptionpublic boolean isModerateAnswer(String id)
isModerateAnswer in interface DataStoragepublic boolean isModerateQuestion(String id)
isModerateQuestion in interface DataStoragepublic boolean isViewAuthorInfo(String id)
isViewAuthorInfo in interface DataStoragepublic boolean isCategoryModerator(String categoryId, String user) throws Exception
isCategoryModerator in interface DataStoragecategoryId - id of categoryuser - usernameExceptionpublic boolean isCategoryExist(String name, String path)
isCategoryExist in interface DataStoragepublic List<String> getQuestionContents(List<String> paths) throws Exception
getQuestionContents in interface DataStorageExceptionpublic Map<String,String> getRelationQuestion(List<String> paths) throws Exception
paths - Exceptionpublic javax.jcr.Node getQuestionNodeById(String path) throws Exception
getQuestionNodeById in interface DataStorageExceptionpublic String[] getModeratorsOf(String path) throws Exception
getModeratorsOf in interface DataStorageExceptionpublic String getCategoryNameOf(String categoryPath) throws Exception
getCategoryNameOf in interface DataStorageExceptionpublic CategoryInfo getCategoryInfo(String categoryPath, List<String> categoryIdScoped) throws Exception
getCategoryInfo in interface DataStorageExceptionpublic void reCalculateInfoOfQuestion(String absPathOfProp) throws Exception
Exceptionpublic void updateQuestionRelatives(String questionPath, String[] relatives) throws Exception
updateQuestionRelatives in interface DataStorageExceptionpublic void calculateDeletedUser(String userName) throws Exception
calculateDeletedUser in interface DataStorageExceptionpublic InputStream createAnswerRSS(String cateId) throws Exception
Exceptionprotected javax.jcr.Node getFAQServiceHome(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
throws Exception
Exceptionprotected static void logDebug(String message)
public void saveActivityIdForQuestion(String questionId, String activityId)
saveActivityIdForQuestion in interface DataStoragepublic String getActivityIdForQuestion(String questionId)
getActivityIdForQuestion in interface DataStoragepublic void saveActivityIdForAnswer(String questionId, Answer answer, String activityId)
saveActivityIdForAnswer in interface DataStoragepublic String getActivityIdForAnswer(String questionId, Answer answer)
getActivityIdForAnswer in interface DataStoragepublic void saveActivityIdForComment(String questionId, String commentId, String language, String activityId)
saveActivityIdForComment in interface DataStoragepublic String getActivityIdForComment(String questionId, String commentId, String language)
getActivityIdForComment in interface DataStoragepublic javax.jcr.Node getAnswerNode(String questionId, Answer answer) throws Exception
ExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.