com.silverpeas.questionReply.control
Class QuestionReplySessionController
java.lang.Object
  
com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
      
com.silverpeas.questionReply.control.QuestionReplySessionController
- All Implemented Interfaces: 
 - com.stratelia.silverpeas.peasCore.ComponentSessionController
 
public class QuestionReplySessionController
- extends com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
 
 
| Fields inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController | 
CHARACTER_ENCODING, context | 
 
| 
Constructor Summary | 
QuestionReplySessionController(com.stratelia.silverpeas.peasCore.MainSessionController mainSessionCtrl,
                               com.stratelia.silverpeas.peasCore.ComponentContext context,
                               String multilangBaseName,
                               String iconBaseName)
 
            | 
 
| 
Method Summary | 
 String | 
addBody(com.stratelia.silverpeas.util.ResourcesWrapper resource,
        File file)
 
            | 
 String | 
addFunction()
 
            | 
 void | 
classifyQuestionReply(long questionId,
                      String positions)
 
          Classify the question reply FAQ on the PdC only if the positions parameter is filled | 
 void | 
closeQuestion(long questionId)
 
            | 
 void | 
closeQuestions(Collection<Long> questionIds)
 
            | 
 void | 
createCategory(Category category)
 
            | 
 void | 
deleteCategory(String categoryId)
 
            | 
 void | 
deleteQuestions(Collection<Long> questionsIds)
 
            | 
 void | 
deleteR(Collection<Long> replyIds)
 
            | 
 void | 
deleteReplies(Collection<Long> replyIds)
 
            | 
 com.silverpeas.importExport.report.ExportReport | 
export(com.stratelia.silverpeas.util.ResourcesWrapper resource)
 
            | 
 void | 
exportCategory(QuestionReplyExport exporter,
               com.stratelia.webactiv.util.node.model.NodeDetail category,
               String categoryId,
               StringBuilder sb)
 
            | 
 String | 
genericWriters()
 
            | 
 Collection<com.stratelia.webactiv.util.node.model.NodeDetail> | 
getAllCategories()
 
            | 
 Collection<Question> | 
getAllQuestions()
 
            | 
 Category | 
getCategory(String categoryId)
 
            | 
 com.stratelia.silverpeas.containerManager.ContainerContext | 
getContainerContext()
 
            | 
 Question | 
getCurrentQuestion()
 
            | 
 String | 
getCurrentQuestionContentId()
 
            | 
 Collection<com.stratelia.webactiv.beans.admin.UserDetail> | 
getCurrentQuestionWriters()
 
            | 
 Reply | 
getCurrentReply()
 
            | 
 Question | 
getNewQuestion()
 
            | 
 Reply | 
getNewReply()
 
            | 
 Question | 
getQuestion(long questionId)
 
            | 
 Collection<Question> | 
getQuestions()
 
            | 
 Collection<Question> | 
getQuestionsByCategory(String categoryId)
 
            | 
 Collection<Reply> | 
getRepliesForQuestion(long id)
 
            | 
 Reply | 
getReply(long replyId)
 
            | 
 String | 
getReturnURL()
 
            | 
 com.stratelia.silverpeas.containerManager.ContainerPositionInterface | 
getSilverContentIdPosition()
 
            | 
 String | 
getUserProfil()
 
            | 
 com.stratelia.webactiv.SilverpeasRole | 
getUserRole()
 
            | 
 String | 
getUserRoleLevel()
 
          Redefinition method de abstractComponentSessionController car 4 rôles Return the highest user's
 role (admin, publisher, writer or user) | 
 boolean | 
isPDCUsed()
 
            | 
 boolean | 
isPrivateRepliesEnabled()
 
            | 
 boolean | 
isReplyVisible(Question question,
               Reply reply)
 
            | 
 void | 
openQuestion(long questionId)
 
            | 
 void | 
relaunchRecipients()
 
            | 
 long | 
saveNewFAQ()
 
          Persist new FAQ inside database and add positions | 
 long | 
saveNewQuestion()
 
            | 
 void | 
saveNewReply()
 
            | 
 void | 
setContainerContext(com.stratelia.silverpeas.containerManager.ContainerContext containerContext)
 
            | 
 void | 
setCurrentQuestion(Question question)
 
            | 
 void | 
setCurrentReply(Reply reply)
 
            | 
 void | 
setNewQuestionContent(String title,
                      String content,
                      String categoryId)
 
            | 
 void | 
setNewReplyContent(String title,
                   String content,
                   int publicReply,
                   int privateReply)
 
            | 
 void | 
setReturnURL(String returnURL)
 
            | 
 void | 
setUserProfil()
 
            | 
 void | 
setUserProfil(String profil)
 
            | 
 String | 
toHTML(File file,
       com.stratelia.silverpeas.util.ResourcesWrapper resource)
 
            | 
 void | 
updateCategory(Category category)
 
            | 
 void | 
updateCurrentQuestion(String title,
                      String content,
                      String categoryId)
 
            | 
 void | 
updateCurrentReply(String title,
                   String content)
 
            | 
 
| Methods inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController | 
addClipboardSelection, clipboardPasteDone, close, getAlertUser, getClipboardCount, getClipboardErrorMessage, getClipboardExceptionError, getClipboardName, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameters, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getFavoriteSpace, getGenericPanel, getHighestSilverpeasUserRole, getIcon, getLanguage, getLastResults, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getServerNameAndPort, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserAvailSpaceIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardError, setClipboardSelectedElement, setComponentRootName, setFavoriteSpaceToMainSessionController, setGenericPanel, setIconFileName, setLastResults, setMultilangFileName, setResourceFileName, setSpaceModeMaintenance | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
QuestionReplySessionController
public QuestionReplySessionController(com.stratelia.silverpeas.peasCore.MainSessionController mainSessionCtrl,
                                      com.stratelia.silverpeas.peasCore.ComponentContext context,
                                      String multilangBaseName,
                                      String iconBaseName)
getQuestions
public Collection<Question> getQuestions()
                                  throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getQuestionsByCategory
public Collection<Question> getQuestionsByCategory(String categoryId)
                                            throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getAllQuestions
public Collection<Question> getAllQuestions()
                                     throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getQuestion
public Question getQuestion(long questionId)
                     throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getRepliesForQuestion
public Collection<Reply> getRepliesForQuestion(long id)
                                        throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getCurrentQuestion
public Question getCurrentQuestion()
 
setCurrentQuestion
public void setCurrentQuestion(Question question)
 
getReply
public Reply getReply(long replyId)
               throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getCurrentReply
public Reply getCurrentReply()
 
setCurrentReply
public void setCurrentReply(Reply reply)
 
getNewQuestion
public Question getNewQuestion()
 
setNewQuestionContent
public void setNewQuestionContent(String title,
                                  String content,
                                  String categoryId)
 
saveNewQuestion
public long saveNewQuestion()
                     throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getNewReply
public Reply getNewReply()
 
setNewReplyContent
public void setNewReplyContent(String title,
                               String content,
                               int publicReply,
                               int privateReply)
 
saveNewFAQ
public long saveNewFAQ()
                throws QuestionReplyException
- Persist new FAQ inside database and add positions
- Parameters:
 Positions - the JSON position request
- Returns:
 - question identifier
 - Throws:
 QuestionReplyException
 
 
saveNewReply
public void saveNewReply()
                  throws QuestionReplyException
- Throws:
 QuestionReplyException
 
updateCurrentQuestion
public void updateCurrentQuestion(String title,
                                  String content,
                                  String categoryId)
                           throws QuestionReplyException
- Throws:
 QuestionReplyException
 
updateCurrentReply
public void updateCurrentReply(String title,
                               String content)
                        throws QuestionReplyException
- Throws:
 QuestionReplyException
 
deleteQuestions
public void deleteQuestions(Collection<Long> questionsIds)
                     throws QuestionReplyException
- Throws:
 QuestionReplyException
 
deleteReplies
public void deleteReplies(Collection<Long> replyIds)
                   throws QuestionReplyException
- Throws:
 QuestionReplyException
 
deleteR
public void deleteR(Collection<Long> replyIds)
             throws QuestionReplyException
- Throws:
 QuestionReplyException
 
closeQuestions
public void closeQuestions(Collection<Long> questionIds)
                    throws QuestionReplyException
- Throws:
 QuestionReplyException
 
closeQuestion
public void closeQuestion(long questionId)
                   throws QuestionReplyException
- Throws:
 QuestionReplyException
 
openQuestion
public void openQuestion(long questionId)
                  throws QuestionReplyException
- Throws:
 QuestionReplyException
 
setUserProfil
public final void setUserProfil()
 
setUserProfil
public void setUserProfil(String profil)
 
getUserProfil
public String getUserProfil()
 
getUserRole
public com.stratelia.webactiv.SilverpeasRole getUserRole()
 
getUserRoleLevel
public String getUserRoleLevel()
- Redefinition method de abstractComponentSessionController car 4 rôles Return the highest user's
 role (admin, publisher, writer or user)
- Specified by:
 getUserRoleLevel in interface com.stratelia.silverpeas.peasCore.ComponentSessionController- Overrides:
 getUserRoleLevel in class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
 
 
 
getSilverContentIdPosition
public com.stratelia.silverpeas.containerManager.ContainerPositionInterface getSilverContentIdPosition()
                                                                                                throws QuestionReplyException
- Throws:
 QuestionReplyException
 
genericWriters
public String genericWriters()
                      throws QuestionReplyException
- Throws:
 QuestionReplyException
 
relaunchRecipients
public void relaunchRecipients()
                        throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getCurrentQuestionWriters
public Collection<com.stratelia.webactiv.beans.admin.UserDetail> getCurrentQuestionWriters()
                                                                                    throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getCurrentQuestionContentId
public String getCurrentQuestionContentId()
 
isPrivateRepliesEnabled
public boolean isPrivateRepliesEnabled()
 
isPDCUsed
public boolean isPDCUsed()
 
setContainerContext
public void setContainerContext(com.stratelia.silverpeas.containerManager.ContainerContext containerContext)
 
getContainerContext
public com.stratelia.silverpeas.containerManager.ContainerContext getContainerContext()
 
setReturnURL
public void setReturnURL(String returnURL)
 
getReturnURL
public String getReturnURL()
 
isReplyVisible
public boolean isReplyVisible(Question question,
                              Reply reply)
 
getAllCategories
public Collection<com.stratelia.webactiv.util.node.model.NodeDetail> getAllCategories()
                                                                               throws QuestionReplyException
- Throws:
 QuestionReplyException
 
createCategory
public void createCategory(Category category)
                    throws QuestionReplyException
- Throws:
 QuestionReplyException
 
getCategory
public Category getCategory(String categoryId)
                     throws QuestionReplyException
- Throws:
 QuestionReplyException
 
updateCategory
public void updateCategory(Category category)
                    throws QuestionReplyException
- Throws:
 QuestionReplyException
 
deleteCategory
public void deleteCategory(String categoryId)
                    throws QuestionReplyException
- Throws:
 QuestionReplyException
 
export
public com.silverpeas.importExport.report.ExportReport export(com.stratelia.silverpeas.util.ResourcesWrapper resource)
                                                       throws QuestionReplyException,
                                                              ParseException
- Throws:
 QuestionReplyException
ParseException
 
toHTML
public String toHTML(File file,
                     com.stratelia.silverpeas.util.ResourcesWrapper resource)
              throws QuestionReplyException,
                     ParseException
- Throws:
 QuestionReplyException
ParseException
 
addFunction
public String addFunction()
 
addBody
public String addBody(com.stratelia.silverpeas.util.ResourcesWrapper resource,
                      File file)
               throws QuestionReplyException,
                      ParseException
- Throws:
 QuestionReplyException
ParseException
 
exportCategory
public void exportCategory(QuestionReplyExport exporter,
                           com.stratelia.webactiv.util.node.model.NodeDetail category,
                           String categoryId,
                           StringBuilder sb)
                    throws QuestionReplyException,
                           ParseException
- Throws:
 QuestionReplyException
ParseException
 
classifyQuestionReply
public void classifyQuestionReply(long questionId,
                                  String positions)
- Classify the question reply FAQ on the PdC only if the positions parameter is filled
- Parameters:
 questionId - the question identifierpositions - the json string positions
 
 
Copyright © 2016 Silverpeas. All Rights Reserved.