KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > weblog > formbeans > WeblogCategoryFormEx


1 package org.roller.presentation.weblog.formbeans;
2
3 import org.roller.RollerException;
4 import org.roller.pojos.WeblogCategoryData;
5 import org.roller.presentation.forms.WeblogCategoryForm;
6
7 /**
8  * Extends the WeblogCategoryForm so that additional properties may be added.
9  * These properties are not persistent and are only needed for the UI.
10  *
11  * @struts.form name="weblogCategoryFormEx"
12  */

13 public class WeblogCategoryFormEx extends WeblogCategoryForm
14 {
15     private String JavaDoc mParentId = null;
16     private boolean mMoveContents = false;
17     private String JavaDoc mMoveToWeblogCategoryId = null;
18
19     public WeblogCategoryFormEx()
20     {
21         super();
22     }
23
24     public WeblogCategoryFormEx(WeblogCategoryData catData, java.util.Locale JavaDoc locale) throws RollerException
25     {
26         super(catData, locale);
27     }
28
29     public String JavaDoc getParentId()
30     {
31         return mParentId;
32     }
33
34     public void setParentId(String JavaDoc parentId)
35     {
36         mParentId = parentId;
37     }
38
39     /** If true then contents should be moved when this folder is removed */
40     public boolean getMoveContents()
41     {
42         return mMoveContents;
43     }
44     
45     public void setMoveContents(boolean flag)
46     {
47         mMoveContents = flag;
48     }
49
50     /** WeblogCategory where contents should be moved if this cat is removed */
51     public String JavaDoc getMoveToWeblogCategoryId()
52     {
53         return mMoveToWeblogCategoryId;
54     }
55
56     public void setMoveToWeblogCategoryId(String JavaDoc id)
57     {
58         mMoveToWeblogCategoryId = id;
59     }
60     
61     /**
62      * @see org.roller.presentation.forms.WeblogCategoryForm#copyFrom(org.roller.pojos.WeblogCategoryData)
63      */

64     public void copyFrom(WeblogCategoryData dataHolder, java.util.Locale JavaDoc locale) throws RollerException
65     {
66         super.copyFrom(dataHolder, locale);
67         try
68         {
69             mParentId = dataHolder.getParent().getId();
70         }
71         catch (RollerException e)
72         {
73             throw new RuntimeException JavaDoc("ERROR fetching parent category.");
74         }
75     }
76
77 }
78
Popular Tags