KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portal > model > PageNode


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.services.portal.model;
6
7 import java.util.* ;
8 /**
9  * Thu, Apr 01, 2004 @ 11:02
10  * @author: Tuan Nguyen
11  * @email: tuan08@users.sourceforge.net
12  * @version: $Id: PageNode.java,v 1.12 2004/10/27 03:11:17 tuan08 Exp $
13  */

14 public class PageNode {
15   protected ArrayList children ;
16   protected String JavaDoc uri ;
17   protected String JavaDoc name ;
18   protected String JavaDoc label ;
19   protected String JavaDoc icon ;
20   protected String JavaDoc viewPermission ;
21   protected String JavaDoc editPermission ;
22   protected List pageReference ;
23   protected String JavaDoc description ;
24   
25   public PageNode() {
26     pageReference = new ArrayList(3) ;
27   }
28   
29   public String JavaDoc getUri() { return uri ; }
30   public void setUri(String JavaDoc s) { uri = s ; }
31
32   public String JavaDoc getName() { return name ; }
33   public void setName(String JavaDoc s) { name = s ; }
34
35   public String JavaDoc getLabel() { return label ; }
36   public void setLabel(String JavaDoc s) { label = s ; }
37   
38   public String JavaDoc getIcon() { return icon ; }
39   public void setIcon(String JavaDoc s) { icon = s ; }
40
41   public String JavaDoc getViewPermission() { return viewPermission ; }
42   public void setViewPermission(String JavaDoc s) { viewPermission = s ; }
43   
44   public String JavaDoc getEditPermission() { return editPermission ; }
45   public void setEditPermission(String JavaDoc s) { editPermission = s ; }
46   
47   public String JavaDoc getDescription() { return description ; }
48   public void setDescription(String JavaDoc s) { description = s ; }
49  
50   public PageReference removePageReference(String JavaDoc type) {
51     for(int i = 0; i < pageReference.size(); i++) {
52       PageReference ref = (PageReference) pageReference.get(i) ;
53       if(type.equals(ref.getType())) {
54         pageReference.remove(i) ;
55         return ref ;
56       }
57     }
58     return null;
59   }
60   
61   public PageReference getPageReference(String JavaDoc type) {
62     for(int i = 0; i < pageReference.size(); i++) {
63       PageReference ref = (PageReference) pageReference.get(i) ;
64       if(type.equals(ref.getType())) return ref ;
65     }
66     return null ;
67   }
68   
69   public List getClonePageReference() {
70     List list = new ArrayList(3) ;
71     for(int i = 0; i < pageReference.size(); i++) {
72       PageReference pref = (PageReference)pageReference.get(i) ;
73       list.add(new PageReference(pref)) ;
74     }
75     return list ;
76   }
77   
78   public List getPageReference() { return pageReference ;}
79   public void setPageReference(List list) { pageReference = list ;}
80   
81   public List getChildren() {
82     if(children == null) children = new ArrayList(3) ;
83     return children ;
84   }
85 }
Popular Tags