KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > ui > authoring > struts > formbeans > WeblogCategoryFormEx


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 package org.apache.roller.ui.authoring.struts.formbeans;
19
20 import org.apache.roller.RollerException;
21 import org.apache.roller.pojos.WeblogCategoryData;
22 import org.apache.roller.ui.authoring.struts.forms.WeblogCategoryForm;
23
24 /**
25  * Extends the WeblogCategoryForm so that additional properties may be added.
26  * These properties are not persistent and are only needed for the UI.
27  *
28  * @struts.form name="weblogCategoryFormEx"
29  */

30 public class WeblogCategoryFormEx extends WeblogCategoryForm
31 {
32     private String JavaDoc mParentId = null;
33     private boolean mMoveContents = false;
34     private String JavaDoc mMoveToWeblogCategoryId = null;
35
36     public WeblogCategoryFormEx()
37     {
38         super();
39     }
40
41     public WeblogCategoryFormEx(WeblogCategoryData catData, java.util.Locale JavaDoc locale) throws RollerException
42     {
43         super(catData, locale);
44     }
45
46     public String JavaDoc getParentId()
47     {
48         return mParentId;
49     }
50
51     public void setParentId(String JavaDoc parentId)
52     {
53         mParentId = parentId;
54     }
55
56     /** If true then contents should be moved when this folder is removed */
57     public boolean getMoveContents()
58     {
59         return mMoveContents;
60     }
61     
62     public void setMoveContents(boolean flag)
63     {
64         mMoveContents = flag;
65     }
66
67     /** WeblogCategory where contents should be moved if this cat is removed */
68     public String JavaDoc getMoveToWeblogCategoryId()
69     {
70         return mMoveToWeblogCategoryId;
71     }
72
73     public void setMoveToWeblogCategoryId(String JavaDoc id)
74     {
75         mMoveToWeblogCategoryId = id;
76     }
77     
78     /**
79      * @see org.apache.roller.ui.authoring.struts.forms.WeblogCategoryForm#copyFrom(org.apache.roller.pojos.WeblogCategoryData)
80      */

81     public void copyFrom(WeblogCategoryData dataHolder, java.util.Locale JavaDoc locale) throws RollerException
82     {
83         super.copyFrom(dataHolder, locale);
84         try
85         {
86             mParentId = dataHolder.getParent().getId();
87         }
88         catch (RollerException e)
89         {
90             throw new RuntimeException JavaDoc("ERROR fetching parent category.");
91         }
92     }
93
94 }
95
Popular Tags