You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2007/05/15 23:40:08 UTC

svn commit: r538332 - /roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java

Author: agilliland
Date: Tue May 15 14:40:08 2007
New Revision: 538332

URL: http://svn.apache.org/viewvc?view=rev&rev=538332
Log:
add standard result for access denied page and a few more common lists used for dropdowns in the UI.


Modified:
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java

Modified: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java?view=diff&rev=538332&r1=538331&r2=538332
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java Tue May 15 14:40:08 2007
@@ -21,10 +21,10 @@
 import com.opensymphony.xwork2.ActionSupport;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 import org.apache.roller.config.RollerConfig;
 import org.apache.roller.config.RollerRuntimeConfig;
-import org.apache.roller.pojos.PermissionsData;
 import org.apache.roller.pojos.UserData;
 import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.ui.core.util.UIUtils;
@@ -44,6 +44,9 @@
 public abstract class UIAction extends ActionSupport 
         implements UIActionPreparable, UISecurityEnforced {
     
+    // a result that sends the user to an access denied warning
+    public static final String DENIED = "access-denied";
+    
     // a common result name used to indicate the result should list some data
     public static final String LIST = "list";
     
@@ -253,6 +256,46 @@
     
     public List getTimeZonesList() {
         return UIUtils.getTimeZones();
+    }
+    
+    public List getHoursList() {
+        List ret = new ArrayList();
+        for (int i=0; i<24; i++) {
+            ret.add(i);
+        }
+        return ret;
+    }
+    
+    public List getMinutesList() {
+        List ret = new ArrayList();
+        for (int i=0; i<60; i++) {
+            ret.add(i);
+        }
+        return ret;
+    }
+    
+    public List getSecondsList() {
+        return getMinutesList();
+    }
+    
+    public List getCommentDaysList() {
+        
+        List opts = new ArrayList();
+        
+        opts.add(new KeyValueObject(new Integer(0), getText("weblogEdit.unlimitedCommentDays")));
+        opts.add(new KeyValueObject(new Integer(1), getText("weblogEdit.days1")));
+        opts.add(new KeyValueObject(new Integer(2), getText("weblogEdit.days2")));
+        opts.add(new KeyValueObject(new Integer(3), getText("weblogEdit.days3")));
+        opts.add(new KeyValueObject(new Integer(4), getText("weblogEdit.days4")));
+        opts.add(new KeyValueObject(new Integer(5), getText("weblogEdit.days5")));
+        opts.add(new KeyValueObject(new Integer(7), getText("weblogEdit.days7")));
+        opts.add(new KeyValueObject(new Integer(10), getText("weblogEdit.days10")));
+        opts.add(new KeyValueObject(new Integer(20), getText("weblogEdit.days20")));
+        opts.add(new KeyValueObject(new Integer(30), getText("weblogEdit.days30")));
+        opts.add(new KeyValueObject(new Integer(60), getText("weblogEdit.days60")));
+        opts.add(new KeyValueObject(new Integer(90), getText("weblogEdit.days90")));
+        
+        return opts;
     }
     
 }