org.exoplatform.answer.webui
Class FAQUtils

java.lang.Object
  extended by org.exoplatform.answer.webui.FAQUtils

public class FAQUtils
extends Object

Created by The eXo Platform SARL Author : Truong Nguyen truong.nguyen@exoplatform.com Apr 14, 2008, 2:56:30 PM


Nested Class Summary
static class FAQUtils.VoteComparator
          The class use for comparator Answers by markVotes.
 
Field Summary
static String COMMA
           
static int DEFAULT_VALUE_UPLOAD_PORTAL
           
static String DISPLAYAPPROVED
           
static String DISPLAYBOTH
           
static String UPLOAD_AVATAR_SIZE
           
static String UPLOAD_FILE_SIZE
           
 
Constructor Summary
FAQUtils()
           
 
Method Summary
static void findCateExist(org.exoplatform.faq.service.FAQService faqService_, UIAnswersContainer fAQContainer)
          Find category which is already exist.
for example: when you are standing in category D in path: Root\A\B\C\D, you do some action (add new category, add question, go out to category C or B) but another moderator delete category C (or B, A).
static List<String> getAllLanguages(org.exoplatform.webui.core.UIComponent component)
           
static List<String> getCategoriesIdFAQPortlet()
           
static String getCurrentUser()
           
static org.exoplatform.services.organization.User getCurrentUserObject()
           
static String getDefaultLanguage()
           
static String getEmailMoveQuestion(org.exoplatform.faq.service.FAQSetting faqSetting)
           
static void getEmailSetting(org.exoplatform.faq.service.FAQSetting faqSetting, boolean isNew, boolean isSettingForm)
           
static String getEmailUser(String userName)
           
static org.exoplatform.faq.service.FAQService getFAQService()
           
static String getFileSource(org.exoplatform.faq.service.FileAttachment attachment)
           
static String getFullName(String userName)
           
static javax.mail.internet.InternetAddress[] getInternetAddress(String addressList)
           
static int getLimitUploadSize(boolean isAvatar)
           
static String getLinkDiscuss(String topicId)
           
static String getLongDateFormat(Date myDate)
           
static void getPorletPreference(org.exoplatform.faq.service.FAQSetting faqSetting)
           
static String getQuestionURI(String param, boolean isAnswer)
          Get question uri by question id of question relative path.
static String getResourceBundle(String resourceBundl)
           
static String getScreenName(String userName, String fullName)
           
static String getShortDateFormat(Date myDate)
           
static String getSubString(String str, int max)
           
static String getTitle(String text)
           
static boolean getUseAjaxFAQPortlet()
           
static String getUserAvatar(String userName)
           
static boolean isFieldEmpty(String s)
           
static boolean isValidEmailAddresses(String addressList)
           
static Map prepareMap(List inputs, Map properties)
           
static void saveFAQPortletPreference(List<String> list, boolean useAjax)
           
static void savePortletPreference(org.exoplatform.faq.service.FAQSetting setting, String emailAddNewQuestion, String emailEditResponseQuestion)
           
static String[] splitForFAQ(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAYAPPROVED

public static String DISPLAYAPPROVED

DISPLAYBOTH

public static String DISPLAYBOTH

UPLOAD_FILE_SIZE

public static String UPLOAD_FILE_SIZE

UPLOAD_AVATAR_SIZE

public static String UPLOAD_AVATAR_SIZE

COMMA

public static final String COMMA

DEFAULT_VALUE_UPLOAD_PORTAL

public static final int DEFAULT_VALUE_UPLOAD_PORTAL
See Also:
Constant Field Values
Constructor Detail

FAQUtils

public FAQUtils()
Method Detail

getFAQService

public static org.exoplatform.faq.service.FAQService getFAQService()
                                                            throws Exception
Throws:
Exception

getDefaultLanguage

public static String getDefaultLanguage()

getAllLanguages

public static List<String> getAllLanguages(org.exoplatform.webui.core.UIComponent component)

findCateExist

public static void findCateExist(org.exoplatform.faq.service.FAQService faqService_,
                                 UIAnswersContainer fAQContainer)
                          throws Exception
Find category which is already exist.
for example: when you are standing in category D in path: Root\A\B\C\D, you do some action (add new category, add question, go out to category C or B) but another moderator delete category C (or B, A). Then this function will be use to find the nearest category with category D (which is exist) and move you into this category.
Detail:
the first, system get category C, if C is exist, you will be moved into C else jump to B and test again.
This processing is done until find a category already exist.

Parameters:
faqService_ - FAQ Service
fAQContainer - UIAnswersContainer this component is used to updated data
sessionProvider - SessionProvider
Throws:
Exception

getInternetAddress

public static javax.mail.internet.InternetAddress[] getInternetAddress(String addressList)
                                                                throws Exception
Throws:
Exception

splitForFAQ

public static String[] splitForFAQ(String str)
                            throws Exception
Throws:
Exception

getCurrentUser

public static String getCurrentUser()
                             throws Exception
Throws:
Exception

getCurrentUserObject

public static org.exoplatform.services.organization.User getCurrentUserObject()
                                                                       throws Exception
Throws:
Exception

getEmailUser

public static String getEmailUser(String userName)
                           throws Exception
Parameters:
userName -
Returns:
email of the user. The current user is implied if userName is null.
Throws:
Exception

getFullName

public static String getFullName(String userName)
                          throws Exception
Parameters:
userName -
Returns:
Full name of user. The current user is implied if userName is null.
Throws:
Exception

getScreenName

public static String getScreenName(String userName,
                                   String fullName)

isFieldEmpty

public static boolean isFieldEmpty(String s)

isValidEmailAddresses

public static boolean isValidEmailAddresses(String addressList)
                                     throws Exception
Throws:
Exception

getResourceBundle

public static String getResourceBundle(String resourceBundl)

prepareMap

public static Map prepareMap(List inputs,
                             Map properties)
                      throws Exception
Throws:
Exception

getSubString

public static String getSubString(String str,
                                  int max)

getTitle

public static String getTitle(String text)

getCategoriesIdFAQPortlet

public static List<String> getCategoriesIdFAQPortlet()
                                              throws Exception
Throws:
Exception

getUseAjaxFAQPortlet

public static boolean getUseAjaxFAQPortlet()

saveFAQPortletPreference

public static void saveFAQPortletPreference(List<String> list,
                                            boolean useAjax)
                                     throws Exception
Throws:
Exception

getPorletPreference

public static void getPorletPreference(org.exoplatform.faq.service.FAQSetting faqSetting)

getEmailSetting

public static void getEmailSetting(org.exoplatform.faq.service.FAQSetting faqSetting,
                                   boolean isNew,
                                   boolean isSettingForm)

getEmailMoveQuestion

public static String getEmailMoveQuestion(org.exoplatform.faq.service.FAQSetting faqSetting)

savePortletPreference

public static void savePortletPreference(org.exoplatform.faq.service.FAQSetting setting,
                                         String emailAddNewQuestion,
                                         String emailEditResponseQuestion)

getLongDateFormat

public static String getLongDateFormat(Date myDate)

getShortDateFormat

public static String getShortDateFormat(Date myDate)

getUserAvatar

public static String getUserAvatar(String userName)
                            throws Exception
Throws:
Exception

getFileSource

public static String getFileSource(org.exoplatform.faq.service.FileAttachment attachment)
                            throws Exception
Throws:
Exception

getQuestionURI

public static String getQuestionURI(String param,
                                    boolean isAnswer)
                             throws Exception
Get question uri by question id of question relative path.

Throws:
Exception

getLinkDiscuss

public static String getLinkDiscuss(String topicId)
                             throws Exception
Throws:
Exception

getLimitUploadSize

public static int getLimitUploadSize(boolean isAvatar)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.