KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > metadata > PageMetaData


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.core.metadata;
10
11 import org.jboss.portal.server.ServerObjectID;
12 import org.jboss.portal.server.metadata.ServerObjectMetaData;
13 import org.jboss.portal.server.plugins.PluginID;
14
15 import java.util.HashSet JavaDoc;
16 import java.util.Set JavaDoc;
17
18 /**
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.6 $
21  */

22 public class PageMetaData extends ServerObjectMetaData
23 {
24
25    // private WindowLocationMetaData defaultWindow;
26
private Set JavaDoc windowSet;
27    private String JavaDoc layoutName = null;
28
29    public PageMetaData(String JavaDoc portalName, String JavaDoc name)
30    {
31       super(new ServerObjectID(new String JavaDoc[]{"page", portalName, name}), name);
32       windowSet = new HashSet JavaDoc();
33       ServerObjectID serverID = ServerObjectID.createPortalID(portalName);
34       PluginID pluginID = new PluginID(serverID, "PAGES");
35       depends.add(pluginID);
36    }
37
38    /**
39     * A page can optionally set a different layout, overwriting the default specified in the portal.
40     *
41     * @return the name of trhe layout to use for this page, or null
42     */

43    public String JavaDoc getLayoutName()
44    {
45       return layoutName;
46    }
47
48    /**
49     * Set the name of the layout to use for this page, overwriting the layout that was specified in the portal.
50     *
51     * @param layoutName the name of the layout to use
52     */

53    public void setLayoutName(String JavaDoc layoutName)
54    {
55       this.layoutName = layoutName;
56    }
57 /*
58    public void setDefaultWindow(WindowLocationMetaData defaultWindow)
59    {
60       this.defaultWindow = defaultWindow;
61    }
62
63    public WindowLocationMetaData getDefaultWindow()
64    {
65       return defaultWindow;
66    }
67 */

68
69    public Set JavaDoc getWindowSet()
70    {
71       return windowSet;
72    }
73
74    public void addWindow(WindowLocationMetaData window)
75    {
76       windowSet.add(window);
77    }
78
79    public boolean equals(Object JavaDoc o)
80    {
81       if (this == o)
82       {
83          return true;
84       }
85       if (o instanceof PageMetaData)
86       {
87          PageMetaData other = (PageMetaData)o;
88          return other.name.equals(name);
89       }
90       return false;
91    }
92
93    public int hashCode()
94    {
95       return name.hashCode();
96    }
97 }
98
Popular Tags