Author: agilliland
Date: Wed May 23 18:15:17 2007
New Revision: 541127

URL: http://svn.apache.org/viewvc?view=rev&rev=541127
Log:
new convenience method for weblog template pojo for checking if a template is 
considered custom.


Modified:
    roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java

Modified: roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java?view=diff&rev=541127&r1=541126&r2=541127
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java (original)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java Wed May 23 
18:15:17 2007
@@ -300,8 +300,12 @@
     }
     
     
-    public void setRequired(boolean req) {
-        // this is an absurd workaround for our struts formbean generation 
stuff
+    /**
+     * A convenience method for testing if this template represents a 'custom'
+     * template, meaning a template with action = ACTION_CUSTOM.
+     */
+    public boolean isCustom() {
+        return ACTION_CUSTOM.equals(getAction()) && !isRequired();
     }
     
     


Reply via email to