View Javadoc
1   /*
2    * Copyright 2008 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not 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.
15   */
16  
17  package com.fatwire.gst.foundation.facade.fsii;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  import com.fatwire.assetapi.data.AssetId;
23  
24  /**
25   * Simple bean containing navigation information like linktext, and url.
26   * <p/>
27   * Other convenience fields are included like the ID of the page and the subtype
28   * of the page asset.
29   * <p/>
30   * Finally, the immediateChildren property contains a list of immediate children
31   * of the current page as stored in the SitePlanTree. This makes this bean an
32   * ideal object for working with navigation systems.
33   * 
34   * @author Tony Field
35   * @since Nov 17, 2009
36   */
37  public final class PageLinkData {
38      private AssetId pageId;
39      private String subtype;
40      private String linktext;
41      private String url;
42      List<PageLinkData> immediateChildren;
43  
44      public AssetId getPageId() {
45          return pageId;
46      }
47  
48      public void setPageId(AssetId pageId) {
49          this.pageId = pageId;
50      }
51  
52      public String getSubtype() {
53          return subtype;
54      }
55  
56      public void setSubtype(String subtype) {
57          this.subtype = subtype;
58      }
59  
60      public String getLinktext() {
61          return linktext;
62      }
63  
64      public void setLinktext(String linktext) {
65          this.linktext = linktext;
66      }
67  
68      public String getUrl() {
69          return url;
70      }
71  
72      public void setUrl(String url) {
73          this.url = url;
74      }
75  
76      public List<PageLinkData> getImmediateChildren() {
77          return immediateChildren;
78      }
79  
80      public void setImmediateChildren(List<PageLinkData> immediateChildren) {
81          this.immediateChildren = immediateChildren;
82      }
83  
84      public void addImmediateChild(PageLinkData child) {
85          if (this.immediateChildren == null) {
86              this.immediateChildren = new ArrayList<PageLinkData>();
87          }
88          this.immediateChildren.add(child);
89      }
90  }