From: <jbo...@li...> - 2006-05-25 06:52:15
|
Author: soh...@jb... Date: 2006-05-25 02:52:10 -0400 (Thu, 25 May 2006) New Revision: 4421 Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/pref/ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/pref/index.xhtml Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/index.xhtml Log: http://jira.jboss.com/jira/browse/JBFORUMS-49 - Manage User Preferences Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -56,6 +56,18 @@ public static final String p_page = "page"; //other constants------------------------------------------------------------------------------------------------------------------------------- public static final String QUOTE = "quote"; + public static final String NOTIFY_REPLY_KEY = "notifyreply"; + public static final String ALLOW_HTML_KEY = "allowhtml"; + public static final String POST_ORDER_KEY = "postorder"; + public static final String DATE_FORMAT_KEY = "dateformat"; + public static final String ALWAYS_SIG_KEY = "alwaysaddsignature"; + public static final String SIG_KEY = "signature"; + public static final String SUMMARY_MODE_KEY = "summarymode"; + public static final String SUMMARY_LIMIT_KEY = "summarytopiclimit"; + public static final String SUMMARY_DAYS_KEY = "summarytopicdays"; + public static final String SUMMARY_REPLIES_KEY = "summarytopicreplies"; + public static final String TOPICS_FORUM_KEY = "topicsperforum"; + public static final String POSTS_TOPIC_KEY = "postspertopic"; /** * DOCUMENT_ME Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -23,6 +23,7 @@ import java.util.Date; +import java.util.Iterator; import java.net.URLEncoder; @@ -162,6 +163,30 @@ return preference; } + + /** + * + * + */ + public static void setPreferences(Map preferences) throws Exception + { + Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest(); + if (!JSFUtil.isAnonymous() && o instanceof PortletRequest) + { + PortletRequest request = (PortletRequest) o; + PortletPreferences pp = request.getPreferences(); + for(Iterator itr=preferences.keySet().iterator();itr.hasNext();) + { + String preferenceKey = (String)itr.next(); + String value = (String)preferences.get(preferenceKey); + if(!pp.isReadOnly(preferenceKey)) + { + pp.setValue(preferenceKey,value); + } + } + pp.store(); + } + } /** * Get a <code>SimpleDateFormat</code> object from the session. The object is stored Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -0,0 +1,407 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.action; + +import java.text.SimpleDateFormat; +import java.util.Map; +import java.util.HashMap; +import java.util.Date; + +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; + +/* + * Created on May 24, 2006 + * + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + */ +public class PreferenceController extends ActionController +{ + /** + * data associated with "notify on reply" + * the default value of this is setup using the managed-property value in the faces config file + */ + private boolean notifyOnReply = false; + + /** + * data associated with "always allow html" + * the default value of this is setup using the managed-property value in the faces config file + */ + private boolean alwaysAllowHtml = false; + + /** + * data associated with "post order" + * the default value of this is setup using the managed-property value in the faces config file + */ + private String postOrder = null; + + /** + * data associated with "date format" + * the default value of this is setup using the managed-property value in the faces config file + */ + private String dateFormat = null; + + /** + * data associated with "always add signature" + * the default value of this is setup using the managed-property value in the faces config file + */ + private boolean alwaysAddSignature = false; + + /** + * data associated with "signature" + */ + private String signature = null; + + /** + * summary related preferences + */ + private int summaryMode = 0; + private int summaryTopicLimit = 0; + private int summaryTopicDays = 0; + private int summaryTopicReplies = 0; + + + /** + * topic related preferences + */ + private int postsPerTopic = 0; + + /** + * forum related preferences + * + */ + private int topicsPerForum = 0; + + /** + * business data + * + */ + private Map defaultPreferences = null; + + //------accessors------------------------------------------------------------------------------------------------------------------------------- + /** + * + */ + public boolean isNotifyOnReply() + { + return this.notifyOnReply; + } + /** + * + * + */ + public void setNotifyOnReply(boolean notifyOnReply) + { + this.notifyOnReply = notifyOnReply; + } + /** + * @return Returns the alwaysAllowHtml. + */ + public boolean isAlwaysAllowHtml() + { + return alwaysAllowHtml; + } + /** + * @param alwaysAllowHtml The alwaysAllowHtml to set. + */ + public void setAlwaysAllowHtml(boolean alwaysAllowHtml) + { + this.alwaysAllowHtml = alwaysAllowHtml; + } + /** + * @return Returns the postOrder. + */ + public String getPostOrder() + { + return postOrder; + } + /** + * @param postOrder The postOrder to set. + */ + public void setPostOrder(String postOrder) + { + this.postOrder = postOrder; + } + /** + * @return Returns the dateFormat. + */ + public String getDateFormat() + { + return dateFormat; + } + /** + * @param dateFormat The dateFormat to set. + */ + public void setDateFormat(String dateFormat) + { + try + { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); + simpleDateFormat.format(new Date()); + } + catch(Exception e) + { + this.dateFormat = this.getPreference(Constants.DATE_FORMAT_KEY); + return; //don't modify with the submitted dateFormat + } + + //if I get here, the input date format is fine + this.dateFormat = dateFormat; + } + /** + * @return Returns the alwaysAddSignature. + */ + public boolean isAlwaysAddSignature() + { + return alwaysAddSignature; + } + /** + * @param alwaysAddSignature The alwaysAddSignature to set. + */ + public void setAlwaysAddSignature(boolean alwaysAddSignature) + { + this.alwaysAddSignature = alwaysAddSignature; + } + /** + * @return Returns the signature. + */ + public String getSignature() + { + return signature; + } + /** + * @param signature The signature to set. + */ + public void setSignature(String signature) + { + this.signature = signature; + } + + /** + * + * + */ + public int getSummaryMode() + { + return this.summaryMode; + } + /** + * + * @param summaryMode + */ + public void setSummaryMode(int summaryMode) + { + this.summaryMode = summaryMode; + } + /** + * + * + */ + public int getSummaryTopicLimit() + { + return this.summaryTopicLimit; + } + /** + * + * @param summaryTopicLimit + */ + public void setSummaryTopicLimit(int summaryTopicLimit) + { + this.summaryTopicLimit = summaryTopicLimit; + } + + /** + * + * + */ + public int getSummaryTopicDays() + { + return this.summaryTopicDays; + } + /** + * + * @param summaryTopicDays + */ + public void setSummaryTopicDays(int summaryTopicDays) + { + this.summaryTopicDays = summaryTopicDays; + } + + /** + * + * + */ + public int getSummaryTopicReplies() + { + return this.summaryTopicReplies; + } + + /** + * + * @param summaryTopicReplies + */ + public void setSummaryTopicReplies(int summaryTopicReplies) + { + this.summaryTopicReplies = summaryTopicReplies; + } + + + + /** + * @return Returns the postsPerTopic. + */ + public int getPostsPerTopic() + { + return postsPerTopic; + } + /** + * @param postsPerTopic The postsPerTopic to set. + */ + public void setPostsPerTopic(int postsPerTopic) + { + this.postsPerTopic = postsPerTopic; + } + /** + * @return Returns the topicsPerForum. + */ + public int getTopicsPerForum() + { + return topicsPerForum; + } + /** + * @param topicsPerForum The topicsPerForum to set. + */ + public void setTopicsPerForum(int topicsPerForum) + { + this.topicsPerForum = topicsPerForum; + } + + /** + * + * + */ + public Map getDefaultPreferences() + { + return this.defaultPreferences; + } + + /** + * + * + */ + public void setDefaultPreferences(Map defaultPreferences) + { + this.defaultPreferences = defaultPreferences; + } + //-------cleanup------------------------------------------------------------------------------------------------------------------------------- + public void cleanup() + { + } + //--------------------------------------------------------------------------------------------------------------------------------------------- + /** + * + * + */ + public PreferenceController() + { + super(); + } + + /** + * + * + */ + public boolean isInitialized() + { + boolean initialized = true; + + this.notifyOnReply = Boolean.valueOf(this.getPreference(Constants.NOTIFY_REPLY_KEY)).booleanValue(); + this.alwaysAllowHtml = Boolean.valueOf(this.getPreference(Constants.ALLOW_HTML_KEY)).booleanValue(); + this.alwaysAddSignature = Boolean.valueOf(this.getPreference(Constants.ALWAYS_SIG_KEY)).booleanValue(); + this.signature = this.getPreference(Constants.SIG_KEY); + this.dateFormat = this.getPreference(Constants.DATE_FORMAT_KEY); + this.postOrder = this.getPreference(Constants.POST_ORDER_KEY); + + this.summaryMode = Integer.parseInt(this.getPreference(Constants.SUMMARY_MODE_KEY)); + this.summaryTopicDays = Integer.parseInt(this.getPreference(Constants.SUMMARY_DAYS_KEY)); + this.summaryTopicLimit = Integer.parseInt(this.getPreference(Constants.SUMMARY_LIMIT_KEY)); + this.summaryTopicReplies = Integer.parseInt(this.getPreference(Constants.SUMMARY_REPLIES_KEY)); + + this.postsPerTopic = Integer.parseInt(this.getPreference(Constants.POSTS_TOPIC_KEY)); + this.topicsPerForum = Integer.parseInt(this.getPreference(Constants.TOPICS_FORUM_KEY)); + + return initialized; + } + + /** + * + * + */ + public String getPreference(String preferenceKey) + { + String preference = null; + + preference = (String)this.defaultPreferences.get(preferenceKey); + + //override the default preference with the logged in user's specified preference + String storedPreference = PortalUtil.getPreference(preferenceKey); + if(storedPreference!=null && storedPreference.trim().length()>0) + { + preference = storedPreference; + } + + return preference; + } + + //----------action----------------------------------------------------------------------------------------------------------------------------- + public String execute() + { + String navState = null; + try + { + Map updated = new HashMap(); + + updated.put(Constants.NOTIFY_REPLY_KEY,String.valueOf(this.notifyOnReply)); + updated.put(Constants.ALLOW_HTML_KEY,String.valueOf(this.alwaysAllowHtml)); + updated.put(Constants.ALWAYS_SIG_KEY,String.valueOf(this.alwaysAddSignature)); + updated.put(Constants.SIG_KEY,this.signature); + updated.put(Constants.POST_ORDER_KEY,this.postOrder); + updated.put(Constants.DATE_FORMAT_KEY,this.dateFormat); + updated.put(Constants.SUMMARY_MODE_KEY,String.valueOf(this.summaryMode)); + updated.put(Constants.SUMMARY_LIMIT_KEY,String.valueOf(this.summaryTopicLimit)); + updated.put(Constants.SUMMARY_DAYS_KEY,String.valueOf(this.summaryTopicDays)); + updated.put(Constants.SUMMARY_REPLIES_KEY,String.valueOf(this.summaryTopicReplies)); + updated.put(Constants.POSTS_TOPIC_KEY,String.valueOf(this.postsPerTopic)); + updated.put(Constants.TOPICS_FORUM_KEY,String.valueOf(this.topicsPerForum)); + + PortalUtil.setPreferences(updated); + + navState = Constants.SUCCESS; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } +} Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -35,6 +35,7 @@ import org.jboss.portlet.forums.ui.JSFUtil; import org.jboss.portlet.forums.ui.ForumUtil; import org.jboss.portlet.forums.ui.PortalUtil; +import org.jboss.portlet.forums.ui.action.PreferenceController; //jsf imports @@ -46,12 +47,9 @@ public class ViewForum extends BaseController { //preference related data - private int topicsPerForum = 0; //feed in the topicsPerForum value as a managed property - private String topicsPerForumKey = null; //feed in the topicsPerForum preference key as managed property + private PreferenceController userPreferences = null; + - //managed bean reference injection - private ViewTopic topicBean = null; //used to extract the posts per topic user preference for now - //business data being generated in this bean by executing ui actions //this is data is created such that it can be consumed by the view components //like facelets @@ -67,17 +65,7 @@ public Forum getForum() { return this.forum; - } - - /** - * - * - */ - public void setTopicBean(ViewTopic topicBean) - { - this.topicBean = topicBean; - } - + } //page navigation related methods on this bean-------------------------------------------------------------------------------------------- /** * @@ -216,47 +204,19 @@ } //------------user preferences------------------------------------------------------------------------------------------------------------- /** - * @return Returns the topicsPerForum. + * @return Returns the userPreferences. */ - public int getTopicsPerForum() + public PreferenceController getUserPreferences() { - return topicsPerForum; + return userPreferences; } /** - * @param topicsPerForum The topicsPerForum to set. + * @param userPreferences The userPreferences to set. */ - public void setTopicsPerForum(int topicsPerForum) + public void setUserPreferences(PreferenceController userPreferences) { - this.topicsPerForum = topicsPerForum; - - //get the user's preferred pageSize for viewing a forum and its list of topics, - //instead of using the default page size - String userPreference = PortalUtil.getPreference(this.topicsPerForumKey); - if(userPreference!=null && userPreference.trim().length()>0) - { - int cour = 0; - try{cour = Integer.parseInt(userPreference);}catch(NumberFormatException nfe){} - if(cour>0) - { - this.topicsPerForum = cour; //here override the default page size with the user's preference - } - } - } - - /** - * @return Returns the topicsPerForumKey. - */ - public String getTopicsPerForumKey() - { - return topicsPerForumKey; - } - /** - * @param topicsPerForumKey The topicsPerForumKey to set. - */ - public void setTopicsPerForumKey(String topicsPerForumKey) - { - this.topicsPerForumKey = topicsPerForumKey; - } + this.userPreferences = userPreferences; + } //------------------------------------------------------------------------------------------------------------------------------------- /** * @@ -326,7 +286,7 @@ //setup the pageNavigator for this forum this.pageNavigator = new PageNavigator( topicObjects, //total number of entries to be split up into pages - this.topicsPerForum, + Integer.parseInt(this.userPreferences.getPreference(Constants.TOPICS_FORUM_KEY)), 0 //currently selected page being displayed, first page by default ); @@ -346,7 +306,7 @@ if(posts!=null && !posts.isEmpty()) { PageNavigator topicNav = new PageNavigator(posts.toArray(), - this.topicBean.getPostsPerTopic(), //this is user's posts per page preference + Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference 0 //current page of the navigator ); this.topicNavigator.put(cour.getId(),topicNav); Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -31,6 +31,8 @@ import org.jboss.portlet.forums.ui.JSFUtil; import org.jboss.portlet.forums.ui.PortalUtil; +import org.jboss.portlet.forums.ui.action.PreferenceController; + //jsf imports @@ -39,17 +41,9 @@ * */ public class ViewSummary extends BaseController -{ - //user preferences for this controller, //initially supplied by the forums-config.xml for default values - //but these values are then stored in the database and is different for different users - private int summaryMode = 0; - private int summaryTopicLimit = 0; - private int summaryTopicDays = 0; - private int summaryTopicReplies = 0; - private String summaryModeKey = null; - private String summaryTopicLimitKey = null; - private String summaryTopicDaysKey = null; - private String summaryTopicRepliesKey = null; +{ + //user preference controller + private PreferenceController userPreferences = null; //business data being generated in this bean by executing ui actions //this is data is created such that it can be consumed by the view components @@ -82,128 +76,21 @@ return String.valueOf(this.getTopics().size()); } - //------------user preferences------------------------------------------------------------------------------------------------------------- + //------------user preferences------------------------------------------------------------------------------------------------------------- /** - * - * @param summaryMode + * @return Returns the userPreferences. */ - public void setSummarymode(int summaryMode) + public PreferenceController getUserPreferences() { - this.summaryMode = summaryMode; - - //overwrite the default value with the user's preference - String storedSummaryMode = PortalUtil.getPreference(this.summaryModeKey); - if(storedSummaryMode!=null && storedSummaryMode.trim().length()>0) - { - this.summaryMode = Integer.parseInt(storedSummaryMode); - } + return userPreferences; } - /** - * - * @param summaryTopicLimit + * @param userPreferences The userPreferences to set. */ - public void setSummarytopiclimit(int summaryTopicLimit) + public void setUserPreferences(PreferenceController userPreferences) { - this.summaryTopicLimit = summaryTopicLimit; - - //overwrite the default value with the user's preference - String storedSummaryTopicLimit = PortalUtil.getPreference(this.summaryTopicLimitKey); - if(storedSummaryTopicLimit!=null && storedSummaryTopicLimit.trim().length()>0) - { - this.summaryTopicLimit = Integer.parseInt(storedSummaryTopicLimit); - } - } - - /** - * - * @param summaryTopicDays - */ - public void setSummarytopicdays(int summaryTopicDays) - { - this.summaryTopicDays = summaryTopicDays; - - //overwrite the default value with the user's preference - String storedSummaryTopicDays = PortalUtil.getPreference(this.summaryTopicDaysKey); - if(storedSummaryTopicDays!=null && storedSummaryTopicDays.trim().length()>0) - { - this.summaryTopicDays = Integer.parseInt(storedSummaryTopicDays); - } - } - - /** - * - * @param summaryTopicReplies - */ - public void setSummarytopicreplies(int summaryTopicReplies) - { - this.summaryTopicReplies = summaryTopicReplies; - - //overwrite the default value with the user's preference - String storedSummaryTopicReplies = PortalUtil.getPreference(this.summaryTopicRepliesKey); - if(storedSummaryTopicReplies!=null && storedSummaryTopicReplies.trim().length()>0) - { - this.summaryTopicReplies = Integer.parseInt(storedSummaryTopicReplies); - } - } - - - /** - * @return Returns the summaryModeKey. - */ - public String getSummaryModeKey() - { - return summaryModeKey; - } - /** - * @param summaryModeKey The summaryModeKey to set. - */ - public void setSummaryModeKey(String summaryModeKey) - { - this.summaryModeKey = summaryModeKey; - } - /** - * @return Returns the summaryTopicDaysKey. - */ - public String getSummaryTopicDaysKey() - { - return summaryTopicDaysKey; - } - /** - * @param summaryTopicDaysKey The summaryTopicDaysKey to set. - */ - public void setSummaryTopicDaysKey(String summaryTopicDaysKey) - { - this.summaryTopicDaysKey = summaryTopicDaysKey; - } - /** - * @return Returns the summaryTopicLimitKey. - */ - public String getSummaryTopicLimitKey() - { - return summaryTopicLimitKey; - } - /** - * @param summaryTopicLimitKey The summaryTopicLimitKey to set. - */ - public void setSummaryTopicLimitKey(String summaryTopicLimitKey) - { - this.summaryTopicLimitKey = summaryTopicLimitKey; - } - /** - * @return Returns the summaryTopicRepliesKey. - */ - public String getSummaryTopicRepliesKey() - { - return summaryTopicRepliesKey; - } - /** - * @param summaryTopicRepliesKey The summaryTopicRepliesKey to set. - */ - public void setSummaryTopicRepliesKey(String summaryTopicRepliesKey) - { - this.summaryTopicRepliesKey = summaryTopicRepliesKey; - } + this.userPreferences = userPreferences; + } //------------------------------------------------------------------------------------------------------------------------------------- /** * @@ -212,16 +99,25 @@ */ public ViewSummary() { - super(); - try - { - this.execute(); - } - catch(Exception e) - { - JSFUtil.handleException(e); - } + super(); } + /** + * + */ + public boolean isInitialized() + { + boolean initialized = false; + try + { + this.execute(); + initialized = true; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return initialized; + } /** * @@ -240,7 +136,7 @@ public String getBlockTopicsType() { String blockTopicsType = ""; - switch(this.summaryMode) + switch(Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_MODE_KEY))) { case Constants.BLOCK_TOPICS_MODE_HOT_TOPICS: blockTopicsType = "L_MODE_HOT_TOPICS"; @@ -265,22 +161,24 @@ private void loadDefaultTopics() throws Exception { Calendar after = Calendar.getInstance(); - after.add(Calendar.DATE, - this.summaryTopicDays); + after.add(Calendar.DATE, - this.userPreferences.getSummaryTopicDays()); Date time = after.getTime(); - switch(this.summaryMode) + int summaryTopicReplies = Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_REPLIES_KEY)); + int summaryTopicLimit = Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_LIMIT_KEY)); + switch(Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_MODE_KEY))) { case Constants.BLOCK_TOPICS_MODE_HOT_TOPICS: - this.topics = BaseController.getForumsModule().findTopicsHot(this.summaryTopicReplies,this.summaryTopicLimit); + this.topics = BaseController.getForumsModule().findTopicsHot(summaryTopicReplies,summaryTopicLimit); break; case Constants.BLOCK_TOPICS_MODE_HOTTEST_TOPICS: - this.topics = BaseController.getForumsModule().findTopicsHottest(time,this.summaryTopicLimit); + this.topics = BaseController.getForumsModule().findTopicsHottest(time,summaryTopicLimit); break; case Constants.BLOCK_TOPICS_MODE_LATEST_POSTS: - this.topics = BaseController.getForumsModule().findTopicsByLatestPosts(this.summaryTopicLimit); + this.topics = BaseController.getForumsModule().findTopicsByLatestPosts(summaryTopicLimit); break; case Constants.BLOCK_TOPICS_MODE_MOST_VIEWED: - this.topics = BaseController.getForumsModule().findTopicsMostViewed(time,this.summaryTopicLimit); + this.topics = BaseController.getForumsModule().findTopicsMostViewed(time,summaryTopicLimit); break; } - } + } } Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-05-25 06:52:10 UTC (rev 4421) @@ -33,6 +33,7 @@ import org.jboss.portlet.forums.ui.ForumUtil; import org.jboss.portlet.forums.ui.JSFUtil; import org.jboss.portlet.forums.ui.PortalUtil; +import org.jboss.portlet.forums.ui.action.PreferenceController; /** @@ -44,8 +45,7 @@ /** * user preference related data */ - private String postsPerTopicKey = null; - private int postsPerTopic = 0; + private PreferenceController userPreferences = null; /** * @@ -139,47 +139,19 @@ } //------------user preferences------------------------------------------------------------------------------------------------------------- /** - * @return Returns the postsPerTopicKey. + * @return Returns the userPreferences. */ - public String getPostsPerTopicKey() + public PreferenceController getUserPreferences() { - return postsPerTopicKey; + return userPreferences; } /** - * @param postsPerTopicKey The postsPerTopicKey to set. + * @param userPreferences The userPreferences to set. */ - public void setPostsPerTopicKey(String postsPerTopicKey) + public void setUserPreferences(PreferenceController userPreferences) { - this.postsPerTopicKey = postsPerTopicKey; - } - - /** - * @return Returns the postsPerTopic. - */ - public int getPostsPerTopic() - { - return postsPerTopic; - } - /** - * @param postsPerTopic The postsPerTopic to set. - */ - public void setPostsPerTopic(int postsPerTopic) - { - this.postsPerTopic = postsPerTopic; - - //override this with the preference specified by the user...if - //nothing is found, use a default value - String userPreference = PortalUtil.getPreference(this.postsPerTopicKey); - if(userPreference!=null && userPreference.trim().length()>0) - { - int cour = -1; - try{cour = Integer.parseInt(userPreference);}catch(NumberFormatException nfe){} - if(cour!=-1) - { - this.postsPerTopic = cour; - } - } - } + this.userPreferences = userPreferences; + } //------------------------------------------------------------------------------------------------------------------------------------- /** @@ -240,7 +212,7 @@ //setup the pageNavigator this.pageNavigator = new PageNavigator( posts.toArray(), //total number of entries to be split up into pages - this.postsPerTopic, + Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), currentPage //currently selected page being displayed, first page by default ); Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2006-05-25 06:52:10 UTC (rev 4421) @@ -143,7 +143,7 @@ L_HTML_HIDE_TAGS=Hide Tags L_HIDE_USER=Hide user L_NOTIFY_ON_REPLY=Notify on reply -L_NOTIFY_ON_REPLY_EXPLAIN=Nofify when your post was replied +L_NOTIFY_ON_REPLY_EXPLAIN=Notify when your post was replied L_NOTIFY_ON_PRIVMSG=Notify on private message L_POPUP_ON_PRIVMSG=Popup on private message L_POPUP_ON_PRIVMSG_EXPLAIN=Popup when you have private message Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-25 06:52:10 UTC (rev 4421) @@ -4,16 +4,15 @@ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd"> -<faces-config> - +<faces-config> <!-- general application configuration --> <application> <!-- jbossportal-facelets integration --> - <!--property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver> - <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler--> + <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver> + <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler> <!-- standalone facelets integration --> - <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> + <!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler--> <!-- custom action listener with integrated authorization checking --> <action-listener>org.jboss.portlet.forums.auth.AuthorizationListener</action-listener> @@ -90,37 +89,10 @@ <managed-bean-scope>request</managed-bean-scope> <!-- user preferences --> <managed-property> - <property-name>summaryModeKey</property-name> - <value>summarymode</value> - </managed-property> - <managed-property> - <property-name>summaryTopicLimitKey</property-name> - <value>summarytopiclimit</value> - </managed-property> - <managed-property> - <property-name>summaryTopicDaysKey</property-name> - <value>summarytopicdays</value> - </managed-property> - <managed-property> - <property-name>summaryTopicRepliesKey</property-name> - <value>summarytopicreplies</value> - </managed-property> - <managed-property> - <property-name>summarymode</property-name> - <value>0</value> - </managed-property> - <managed-property> - <property-name>summarytopiclimit</property-name> - <value>6</value> - </managed-property> - <managed-property> - <property-name>summarytopicdays</property-name> - <value>20</value> - </managed-property> - <managed-property> - <property-name>summarytopicreplies</property-name> - <value>15</value> - </managed-property> + <property-name>userPreferences</property-name> + <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class> + <value>#{prefController}</value> + </managed-property> </managed-bean> <!-- configuration for ViewCategory --> @@ -137,18 +109,10 @@ <managed-bean-scope>request</managed-bean-scope> <!-- user preferences related configuration --> <managed-property> - <property-name>topicsPerForumKey</property-name> - <value>topicsperforum</value> - </managed-property> - <managed-property> - <property-name>topicsPerForum</property-name> - <value>10</value> - </managed-property> - <managed-property> - <property-name>topicBean</property-name> - <property-class>org.jboss.portlet.forums.ui.view.ViewTopic</property-class> - <value>#{topic}</value> - </managed-property> + <property-name>userPreferences</property-name> + <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class> + <value>#{prefController}</value> + </managed-property> </managed-bean> <navigation-rule> <from-view-id>/views/forums/viewforum_body.xhtml</from-view-id> @@ -165,13 +129,10 @@ <managed-bean-scope>request</managed-bean-scope> <!-- user preferences related configuration --> <managed-property> - <property-name>postsPerTopicKey</property-name> - <value>postspertopic</value> - </managed-property> - <managed-property> - <property-name>postsPerTopic</property-name> - <value>5</value> - </managed-property> + <property-name>userPreferences</property-name> + <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class> + <value>#{prefController}</value> + </managed-property> </managed-bean> <navigation-rule> <from-view-id>/views/topics/viewtopic_body.xhtml</from-view-id> @@ -378,18 +339,88 @@ <navigation-case> <from-outcome>deleteForum</from-outcome> <to-view-id>/views/admin/index.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <!-- managedBean for the user preference usecase --> + <managed-bean> + <managed-bean-name>prefController</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.action.PreferenceController</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + <managed-property> + <property-name>defaultPreferences</property-name> + <map-entries> + <key-class>java.lang.String</key-class> + <map-entry> + <key>notifyreply</key> + <value>true</value> + </map-entry> + <map-entry> + <key>allowhtml</key> + <value>true</value> + </map-entry> + <map-entry> + <key>postorder</key> + <value>ascending</value> + </map-entry> + <map-entry> + <key>dateformat</key> + <value>EEE MMM d, yyy</value> + </map-entry> + <map-entry> + <key>alwaysaddsignature</key> + <value>false</value> + </map-entry> + <map-entry> + <key>signature</key> + <value></value> + </map-entry> + <map-entry> + <key>summarymode</key> + <value>0</value> + </map-entry> + <map-entry> + <key>summarytopiclimit</key> + <value>6</value> + </map-entry> + <map-entry> + <key>summarytopicdays</key> + <value>20</value> + </map-entry> + <map-entry> + <key>summarytopicreplies</key> + <value>15</value> + </map-entry> + <map-entry> + <key>topicsperforum</key> + <value>10</value> + </map-entry> + <map-entry> + <key>postspertopic</key> + <value>15</value> + </map-entry> + </map-entries> + </managed-property> + </managed-bean> + <navigation-rule> + <from-view-id>/views/pref/index.xhtml</from-view-id> + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/views/category/viewcategory_body.xhtml</to-view-id> </navigation-case> - </navigation-rule> - <managed-bean> - <managed-bean-name>deleteTopic</managed-bean-name> - <managed-bean-class>org.jboss.portlet.forums.ui.action.DeleteTopic</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - </managed-bean> - <navigation-rule> - <from-view-id>/views/moderator/delete_topic.xhtml</from-view-id> - <navigation-case> - <from-action>#{deleteTopic.confirmDelete}</from-action> - <to-view-id>/views/moderator/modcp_body.xhtml</to-view-id> - </navigation-case> - </navigation-rule> + </navigation-rule> + + + <managed-bean> + <managed-bean-name>deleteTopic</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.action.DeleteTopic</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> + <navigation-rule> + <from-view-id>/views/moderator/delete_topic.xhtml</from-view-id> + <navigation-case> + <from-action>#{deleteTopic.confirmDelete}</from-action> + <to-view-id>/views/moderator/modcp_body.xhtml</to-view-id> + </navigation-case> + </navigation-rule> </faces-config> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml 2006-05-25 06:52:10 UTC (rev 4421) @@ -125,18 +125,14 @@ <preference> <name>postspertopic</name> <value>15</value> - </preference> - <!-- not yet integrated with the JSF layer --> + </preference> <preference> <name>notifyreply</name> - <value>1</value> + <value>true</value> </preference> <preference> <name>allowhtml</name> - <value>1</value> - <!-- - <read-only>true</read-only> - --> + <value>true</value> </preference> <preference> <name>postorder</name> @@ -145,6 +141,14 @@ <preference> <name>dateformat</name> <value>EEE MMM d, yyyy HH:mm aaa</value> + </preference> + <preference> + <name>alwaysaddsignature</name> + <value>true</value> + </preference> + <preference> + <name>signature</name> + <value></value> </preference> </portlet-preferences> </portlet> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/index.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/index.xhtml 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/index.xhtml 2006-05-25 06:52:10 UTC (rev 4421) @@ -30,14 +30,18 @@ class="bb" > -<!-- load forums summary page if summary is not empty --> -<c:if test="#{summary.numberOfTopicsFound>0}"> - <ui:include src="/views/summary/viewsummary_body.xhtml"/> -</c:if> +<c:if test="#{summary.initialized}"> -<!-- if summary is empty load the main category page --> -<c:if test="#{summary.numberOfTopicsFound==0}"> - <ui:include src="/views/category/viewcategory_body.xhtml"/> + <!-- load forums summary page if summary is not empty --> + <c:if test="#{summary.numberOfTopicsFound>0}"> + <ui:include src="/views/summary/viewsummary_body.xhtml"/> + </c:if> + + <!-- if summary is empty load the main category page --> + <c:if test="#{summary.numberOfTopicsFound==0}"> + <ui:include src="/views/category/viewcategory_body.xhtml"/> + </c:if> + </c:if> </div> \ No newline at end of file Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/pref/index.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/pref/index.xhtml 2006-05-25 05:01:36 UTC (rev 4420) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/pref/index.xhtml 2006-05-25 06:52:10 UTC (rev 4421) @@ -0,0 +1,251 @@ +<!-- +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +--> + +<div xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb"> + + <ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> + + <c:if test="#{prefController.initialized}"> + <h:form> + <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> + <!-- title --> + <tr> + <th class="thSides" colspan="2" height="25" valign="middle">${resource.L_PREFERENCES}</th> + </tr> + + <!-- notify on reply --> + <tr> + <td class="row1"><span class="gen">${resource.L_NOTIFY_ON_REPLY}:</span><br/> + <span class="gensmall">${resource.L_NOTIFY_ON_REPLY_EXPLAIN}</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.notifyOnReply}" styleClass="gen"> + <f:selectItem itemValue="true" itemLabel="${resource.L_YES}"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="false" itemLabel="${resource.L_NO}"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Always allow html --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_ALWAYS_ALLOW_HTML}:</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.alwaysAllowHtml}" styleClass="gen"> + <f:selectItem itemValue="true" itemLabel="${resource.L_YES}"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="false" itemLabel="${resource.L_NO}"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Post Order --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_POST_ORDER}:</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.postOrder}" styleClass="gen"> + <f:selectItem itemValue="ascending" itemLabel="${resource.L_ASCENDING}"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="descending" itemLabel="${resource.L_DESCENDING}"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Topics Per Page --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_TOPICS_PER_FORUM}:</span><br/> + <span class="gensmall">${resource.L_TOPICS_PER_FORUM_EXPLAIN}</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.topicsPerForum}" styleClass="gen"> + <f:selectItem itemValue="5" itemLabel="5"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="10" itemLabel="10"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="15" itemLabel="15"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="20" itemLabel="20"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="25" itemLabel="25"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="30" itemLabel="30"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Posts Per Page --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_POSTS_PER_TOPIC}:</span><br/> + <span class="gensmall">${resource.L_POSTS_PER_TOPIC_EXPLAIN}</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.postsPerTopic}" styleClass="gen"> + <f:selectItem itemValue="5" itemLabel="5"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="10" itemLabel="10"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="15" itemLabel="15"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="20" itemLabel="20"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="25" itemLabel="25"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="30" itemLabel="30"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Date Format --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_DATE_FORMAT}:</span> + </td> + <td class="row2"> + <h:inputText maxlength="14" styleClass="post" value="#{prefController.dateFormat}"/> + </td> + </tr> + + <tr> + <th class="thSides" colspan="2" height="25" valign="middle">${resource.L_USER_INFO}</th> + </tr> + + <!-- Always add Signature --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_ALWAYS_ADD_SIGNATURE}:</span> + </td> + <td class="row2"> + <h:selectOneRadio value="#{prefController.alwaysAddSignature}" styleClass="gen"> + <f:selectItem itemValue="true" itemLabel="${resource.L_YES}"> + <f:verbatim>&nbsp;&nbsp;</f:verbatim> + </f:selectItem> + <f:selectItem itemValue="false" itemLabel="${resource.L_NO}"/> + </h:selectOneRadio> + </td> + </tr> + + <!-- Signature --> + <tr> + <td class="row1"> + <span class="gen">${resource.L_SIGNATURE}:</span><br/> + <span class="gensmall">${resource.L_SIGNATURE_EXPLAIN} + <br/><br/><br/><br/> + </span> + </td> + <td class="row2"> + <h:inputTextarea style="width: 300px" rows="6" cols="30" styleClass="post" value="#{prefController.signature}"/> + </td> + </tr> + + <!-- Topic Summary --> + <tr> + <th class="thSides" colspan="2" height="25" valign="middle">${resource.L_TOPIC_SUMMARY}</th> + </tr> + + <!-- Summary Mode --> + <tr> + <td class="row1"><span class="gen">${resource.L_MODE_CHOOSE}:</span><br/> + <span class="gensmall">${resource.L_MODE_CHOOSE_EXPLAIN}</span> + </td> + <td class="row2"> + <h:selectOneMenu value="#{prefController.summaryMode}"> + <f:selectItem itemValue="1" itemLabel="Hot topics (above some number of replies)" styleClass="gen"/> + <f:selectItem itemValue="0" itemLabel="Latest posted topics" styleClass="gen"/> + <f:selectItem itemValue="2" itemLabel="Hottest topics (most replied)" styleClass="gen"/> + <f:selectItem itemValue="3" itemLabel="Most viewed topics" styleClass="gen"/> + </h:selectOneMenu> + </td> + </tr> + + <!-- Topics Limit --> + <tr> + <td class="row1"><span class="gen">${resource.L_TOPIC_SUMMARY_LIMIT}:</span><br/> + <span class="gensmall">${resource.L_TOPIC_SUMMARY_LIMIT_EXPLAIN}</span> + </td> + <td class="row2"> + <h:inputText maxlength="7" styleClass="post" value="#{prefController.summaryTopicLimit}"/> + </td> + </tr> + + <!-- Days Old Posts --> + <tr> + <td class="row1"><span class="gen">${resource.L_TOPIC_SUMMARY_DAYS}:</span><br/> + <span class="gensmall">${resource.L_TOPIC_SUMMARY_DAYS_EXPLAIN}</span> + </td> + <td class="row2"> + <h:inputText maxlength="7" styleClass="post" value="#{prefController.summaryTopicDays}"/> + </td> + </tr> + + <!-- Replies in Topic --> + <tr> + <td class="row1"><span class="gen">${resource.L_TOPIC_SUMMARY_REPLIES}:</span><br/> + <span class="gensmall">${resource.L_TOPIC_SUMMARY_REPLIES_EXPLAIN}</span> + </td> + <td class="row2"> + <h:inputText maxlength="7" styleClass="post" value="#{prefController.summaryTopicReplies}"/> + </td> + </tr> + + + <!-- buttons --> + <tr> + <td class="catBottom" colspan="2" align="center" height="28"> + <h:commandButton value="${resource.L_SUBMIT}" styleClass="mainoption" action="#{prefController.execute}"/> + &nbsp;&nbsp; + <h:commandButton type="reset" value="${L_RESET}" styleClass="liteoption"/> + </td> + </tr> + </table> + </h:form> + </c:if> + + </ui:define> + </ui:composition> +</div> \ No newline at end of file |