|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.faq.service.impl.MultiLanguages
public class MultiLanguages
MultiLanguages class allow question and category have multi language. Question content and category's name is can written by one or more languages. But only default language (only one language is default in system) is set as property of question/ category, other languages is children of question/category.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
MultiLanguages()
Class constructor, instantiates a new multi languages. |
|
| Method Summary | |
|---|---|
static void |
addLanguage(javax.jcr.Node questionNode,
QuestionLanguage language)
Adds the language node, when question have multi language, each language is a child node of question node. |
protected javax.jcr.Value[] |
booleanToValues(javax.jcr.Node node,
Boolean[] bools)
|
static void |
deleteAnswerQuestionLang(javax.jcr.Node questionNode,
String answerId,
String language)
|
static void |
deleteCommentQuestionLang(javax.jcr.Node questionNode,
String commentId,
String language)
|
static Answer |
getAnswerById(javax.jcr.Node questionNode,
String answerid,
String language)
|
static Comment |
getCommentById(javax.jcr.Node questionNode,
String commentId,
String language)
|
static QuestionLanguage |
getQuestionLanguageByLanguage(javax.jcr.Node questionNode,
String language)
|
static void |
removeLanguage(javax.jcr.Node questionNode,
List<String> listLanguage)
Removes the language, when question have multi language, and now one of them is not helpful, and admin or moderator want to delete it, this function will be called. |
static void |
removeLanguage(javax.jcr.Node questionNode,
QuestionLanguage lang)
|
static void |
saveAnswer(javax.jcr.Node questionNode,
Answer answer,
String language)
|
static void |
saveAnswer(javax.jcr.Node quesNode,
QuestionLanguage questionLanguage)
|
static void |
saveComment(javax.jcr.Node questionNode,
Comment comment,
String language)
|
static void |
unVoteQuestion(javax.jcr.Node questionNode,
String userName)
|
static void |
voteAnswer(javax.jcr.Node answerNode,
String userName,
boolean isUp)
|
static void |
voteQuestion(javax.jcr.Node questionNode,
String userName,
int number)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiLanguages()
| Method Detail |
|---|
public static void addLanguage(javax.jcr.Node questionNode,
QuestionLanguage language)
throws Exception
questionNode - the question node which have multi languagelanguage - the language which is added in to questionNode
Exception - throw an exception when save a new language node
public static void deleteAnswerQuestionLang(javax.jcr.Node questionNode,
String answerId,
String language)
throws Exception
Exception
public static void deleteCommentQuestionLang(javax.jcr.Node questionNode,
String commentId,
String language)
throws Exception
Exception
public static QuestionLanguage getQuestionLanguageByLanguage(javax.jcr.Node questionNode,
String language)
throws Exception
Exception
public static Comment getCommentById(javax.jcr.Node questionNode,
String commentId,
String language)
throws Exception
Exception
public static Answer getAnswerById(javax.jcr.Node questionNode,
String answerid,
String language)
throws Exception
Exception
public static void saveAnswer(javax.jcr.Node questionNode,
Answer answer,
String language)
throws Exception
Exception
public static void saveAnswer(javax.jcr.Node quesNode,
QuestionLanguage questionLanguage)
throws Exception
Exception
public static void saveComment(javax.jcr.Node questionNode,
Comment comment,
String language)
throws Exception
Exception
protected javax.jcr.Value[] booleanToValues(javax.jcr.Node node,
Boolean[] bools)
throws Exception
Exception
public static void removeLanguage(javax.jcr.Node questionNode,
List<String> listLanguage)
Get all children nodes of question node, and compare them with list language is inputted in this function. Each language node, if it's name is not contained in list language, it will be deleted.
After that, the remains of language nodes will be saved as children node of question node.
questionNode - the question node which have multilanguagelistLanguage - the list languages will be saved
public static void removeLanguage(javax.jcr.Node questionNode,
QuestionLanguage lang)
public static void voteAnswer(javax.jcr.Node answerNode,
String userName,
boolean isUp)
throws Exception
Exception
public static void voteQuestion(javax.jcr.Node questionNode,
String userName,
int number)
throws Exception
Exception
public static void unVoteQuestion(javax.jcr.Node questionNode,
String userName)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||