KickJava   Java API By Example, From Geeks To Geeks.

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


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
19 package org.apache.roller.ui.authoring.struts.formbeans;
20
21 import org.apache.struts.upload.FormFile;
22 import org.apache.roller.RollerException;
23 import org.apache.roller.pojos.FolderData;
24 import org.apache.roller.ui.authoring.struts.forms.FolderForm;
25
26
27 /**
28  * Extends the FolderForm so that additional properties may be added.
29  * These properties are not persistent and are only needed for the UI.
30  *
31  * @struts.form name="folderFormEx"
32  */

33 public class FolderFormEx extends FolderForm
34 {
35     private boolean mMoveContents = false;
36     private String JavaDoc mMoveToFolderId = null;
37     private String JavaDoc[] mSelectedBookmarks = null;
38     private String JavaDoc[] mSelectedFolders = null;
39     private transient FormFile mBookmarksFile = null;
40
41     public FolderFormEx()
42     {
43         super();
44     }
45
46     public FolderFormEx(FolderData folderData, java.util.Locale JavaDoc locale) throws RollerException
47     {
48         super(folderData, locale);
49     }
50
51     public String JavaDoc getShortenedDesc()
52     {
53         if ( getDescription().length() > 20 )
54         {
55             return getDescription().substring(0,19)+"...";
56         }
57         return getDescription();
58     }
59
60     public void setShortenedDesc( String JavaDoc desc )
61     {
62         // readonly
63
}
64
65     //------------------------------------------------- Property bookmarksFile
66

67     /** Bookmark file to be imported */
68     public void setBookmarksFile(FormFile file) { mBookmarksFile = file; }
69
70     /** Bookmark file to be imported */
71     public FormFile getBookmarksFile() { return mBookmarksFile; }
72
73     //-------------------------------------------------- Property moveContents
74

75     /** If true then contents should be moved when this folder is removed */
76     public boolean getMoveContents() { return mMoveContents; }
77
78     /** If true then contents should be moved when this folder is removed */
79     public void setMoveContents( boolean flag ) { mMoveContents = flag;}
80
81     //------------------------------------------------ Property moveToFolderId
82

83     /** Folder where contents should be moved if this folder is removed */
84     public String JavaDoc getMoveToFolderId() { return mMoveToFolderId; }
85
86     /** Folder where contents should be moved if this folder is removed */
87     public void setMoveToFolderId( String JavaDoc id ) { mMoveToFolderId = id;}
88
89     //--------------------------------------------- Property selectedBookmarks
90

91     /** Get selected bookmarks */
92     public String JavaDoc[] getSelectedBookmarks() { return mSelectedBookmarks; }
93
94     /** Set selected bookmarks */
95     public void setSelectedBookmarks( String JavaDoc[] b ) { mSelectedBookmarks = b; }
96
97     //--------------------------------------------- Property selectedBookmarks
98

99     /** Get selected folders */
100     public String JavaDoc[] getSelectedFolders() { return mSelectedFolders; }
101
102     /** Set selected bookmarks */
103     public void setSelectedFolders( String JavaDoc[] f ) { mSelectedFolders = f; }
104 }
105
106
Popular Tags