use of it.vige.rubia.theme.FolderType in project rubia-forums by flashboss.
the class ThemeHelper method getFolderType.
/**
* @param topic
* the topic to find
*
* @return the folder type
*/
public String getFolderType(Topic topic) {
// Getting ResourceBundle with current Locale
FacesContext ctx = getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
Locale locale = uiRoot.getLocale();
ClassLoader ldr = currentThread().getContextClassLoader();
ResourceBundle bundle = getBundle("ResourceJSF", locale, ldr);
String topicType = null;
int topicStatus = topic.getStatus();
FolderType folderType = theme.getFolderType(topic.getType(), topicStatus, topic.getReplies() >= hotThreshold);
try {
if (topicStatus != Constants.TOPIC_MOVED) {
try {
topicType = bundle.getString(folderType.type);
} catch (MissingResourceException e) {
topicType = "";
}
} else {
topicType = bundle.getString("Topic_Moved");
}
} catch (Exception e) {
return "";
}
return topicType;
}
use of it.vige.rubia.theme.FolderType in project rubia-forums by flashboss.
the class ThemeHelper method getFolderTypeURL.
/**
* @param topic
* the topic to find
* @param isAnonymous
* true if you want search the guest folder url
*
* @return the folder type url
*/
public String getFolderTypeURL(Topic topic, boolean isAnonymous) {
String folderTypeURL = getURL("resourceFolderURL");
FolderType folderType = theme.getFolderType(topic.getType(), topic.getStatus(), topic.getReplies() >= hotThreshold);
if (!isAnonymous) {
Date lastPostDate = topic.getLastPostDate();
Date lastLoginDate = getUserLastLoginDate(userModule, userProfileModule);
if (lastPostDate == null || lastLoginDate == null || lastPostDate.compareTo(lastLoginDate) <= 0) {
folderTypeURL = folderType.getFolder();
} else {
folderTypeURL = folderType.getFolderNew();
}
} else {
folderTypeURL = folderType.getFolder();
}
return folderTypeURL;
}
Aggregations