01: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.layout.alm;
07:
08: import org.jasig.portal.layout.node.IUserLayoutFolderDescription;
09: import org.jasig.portal.layout.node.IUserLayoutNodeDescription;
10:
11: /**
12: * UserLayoutFolder summary sentence goes here.
13: * <p>
14: * Company: Instructional Media & Magic
15: *
16: * Prior to uPortal 2.5, this class existed in the package org.jasig.portal.layout.
17: * It was moved to its present package to reflect that it is part of Aggregated
18: * Layouts.
19: *
20: * @author Michael Ivanov mailto:mvi@immagic.com
21: * @version $Revision: 35724 $
22: */
23: public class ALFolder extends ALNode {
24:
25: protected String firstChildNodeId;
26:
27: public ALFolder() {
28: super ();
29: }
30:
31: public ALFolder(IALFolderDescription nd) {
32: super (nd);
33: }
34:
35: /**
36: * Gets the node type
37: * @return a node type
38: */
39: public int getNodeType() {
40: return IUserLayoutNodeDescription.FOLDER;
41: }
42:
43: /**
44: * Sets the first child node ID
45: */
46: public void setFirstChildNodeId(String firstChildNodeId) {
47: this .firstChildNodeId = firstChildNodeId;
48: }
49:
50: /**
51: * Gets the first child node ID
52: * @return a first child node ID
53: */
54: public String getFirstChildNodeId() {
55: return firstChildNodeId;
56: }
57:
58: public static ALFolder createLostFolder() {
59: ALFolder lostFolder = new ALFolder();
60: ALFolderDescription folderDesc = new ALFolderDescription();
61: folderDesc.setId(IALFolderDescription.LOST_FOLDER_ID);
62: folderDesc.setHidden(true);
63: folderDesc.setImmutable(false);
64: folderDesc.setUnremovable(true);
65: folderDesc
66: .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
67: lostFolder.setNodeDescription(folderDesc);
68: lostFolder.setParentNodeId(IALFolderDescription.ROOT_FOLDER_ID);
69: return lostFolder;
70: }
71:
72: public static ALFolder createRootFolder() {
73: ALFolder rootFolder = new ALFolder();
74: ALFolderDescription folderDesc = new ALFolderDescription();
75: folderDesc.setId(IALFolderDescription.ROOT_FOLDER_ID);
76: folderDesc.setHidden(false);
77: folderDesc.setImmutable(false);
78: folderDesc.setUnremovable(true);
79: folderDesc.setName("Root folder");
80: folderDesc
81: .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
82: rootFolder.setNodeDescription(folderDesc);
83: return rootFolder;
84: }
85:
86: }
|