KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > containers > JahiaContainerSubDefinition


1 //
2
// JahiaContainerSubDefinition
3
// EV 25.11.2000
4
//
5
// getID
6
// getPageDefID
7
// getTitle
8
// getStructure
9
//
10
// setID
11
// setTitle
12
// setStructure
13
//
14

15 package org.jahia.data.containers;
16
17 /**
18  * The purpose of this object is to store what page uses a certain container
19  * definition. At least that's what I understand from Eric's code. Title may
20  * vary from original title in sub definition.
21  *
22  * @todo FIND WHAT THIS IS FOR ...
23  */

24
25 import java.util.Vector JavaDoc;
26
27 import org.jahia.exceptions.JahiaException;
28 import java.io.Serializable JavaDoc;
29
30
31 public class JahiaContainerSubDefinition implements Serializable JavaDoc {
32
33
34     private int ID;
35     private int ctnDefID;
36     private int pageDefID;
37     private String JavaDoc title;
38     private Vector JavaDoc structure;
39
40
41     /***
42         * constructor
43         * EV 13.02.2001
44         *
45         */

46     public JahiaContainerSubDefinition( int ID,
47                                         int ctnDefID,
48                                         int pageDefID,
49                                         String JavaDoc title,
50                                         Vector JavaDoc structure )
51     throws JahiaException
52     {
53         this.ID = ID;
54         this.ctnDefID = ctnDefID;
55         this.pageDefID = pageDefID;
56         this.title = title;
57         this.structure = structure;
58     } // end constructor
59

60
61     /***
62         * constructor
63         * EV 13.02.2001
64         *
65         */

66     public JahiaContainerSubDefinition( int ID,
67                                         int pageDefID,
68                                         String JavaDoc title,
69                                         Vector JavaDoc structure )
70     throws JahiaException
71     {
72         this.ID = ID;
73         this.ctnDefID = 0;
74         this.pageDefID = pageDefID;
75         this.title = title;
76         this.structure = structure;
77     } // end constructor
78

79     /**
80      * No arg constructor required for serialization support.
81      */

82     protected JahiaContainerSubDefinition () {
83
84     }
85
86     /***
87         * accessor methods
88         * EV 25.11.2000
89         *
90         */

91     public int getID() { return ID; }
92     public int getCtnDefID() { return ctnDefID; }
93     public int getPageDefID() { return pageDefID; }
94     public String JavaDoc getTitle() { return title; }
95     public Vector JavaDoc getStructure() { return structure; }
96
97     public void setID( int ID ) { this.ID = ID; }
98     public void setTitle( String JavaDoc value ) { this.title = value; }
99     public void setStructure( Vector JavaDoc structure ) { this.structure = structure; }
100
101
102     public void composeStructure( Vector JavaDoc struct )
103     throws JahiaException
104     {
105         this.structure = new Vector JavaDoc();
106         if (struct != null) {
107             for (int i=0; i < struct.size(); i++)
108             {
109                 this.structure.add( new JahiaContainerStructure(
110                                     (String JavaDoc)struct.elementAt(i), this.getID(), i, pageDefID ) );
111
112             }
113         }
114     }
115     // end accessor methods
116

117
118 } // end JahiaContainerSubDefinition
119
Popular Tags