001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.om.page;
018:
019: import java.util.List;
020:
021: import org.apache.jetspeed.om.folder.MenuDefinition;
022: import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
023: import org.apache.jetspeed.om.folder.MenuIncludeDefinition;
024: import org.apache.jetspeed.om.folder.MenuOptionsDefinition;
025: import org.apache.jetspeed.om.folder.MenuSeparatorDefinition;
026:
027: /**
028: * This interface represents a complete page document used by Jetspeed
029: * to layout a user-customizable portal page.
030: *
031: * @version $Id: Page.java 516448 2007-03-09 16:25:47Z ate $
032: */
033: public interface Page extends Document, java.io.Serializable {
034: String DOCUMENT_TYPE = ".psml";
035:
036: /**
037: * Returns the name of the default skin that applies to this
038: * page.
039: *
040: * @return the page default skin name
041: */
042: String getSkin();
043:
044: /**
045: * Modifies the skin for this page.
046: *
047: * @param skinName the name of the new skin for the page
048: */
049: void setSkin(String skinName);
050:
051: /**
052: * Returns the name of the default decorator as set here or
053: * in parent folders that applies in this page to fragments
054: * of the specified type.
055: *
056: * @param fragmentType the type of fragment considered
057: * @return the decorator name for the selected type
058: */
059: String getEffectiveDefaultDecorator(String fragmentType);
060:
061: /**
062: * Returns the name of the default decorator that applies in this page
063: * to fragments of the specified type
064: *
065: * @param fragmentType the type of fragment considered
066: * @return the decorator name for the selected type
067: */
068: String getDefaultDecorator(String fragmentType);
069:
070: /**
071: * Modifies the default decorator for the specified fragment type.
072: *
073: * @param decoratorName the name of the new decorator for the type
074: * @param fragmentType the type of fragment considered
075: */
076: void setDefaultDecorator(String decoratorName, String fragmentType);
077:
078: /**
079: * Retrieves the top level fragment of this page. This Fragment should
080: * never be null.
081: *
082: * @return the base Fragment object for this page.
083: */
084: Fragment getRootFragment();
085:
086: /**
087: * Sets the top level fragment of this page. This Fragment should
088: * never be null.
089: *
090: * @return the base Fragment object for this page.
091: */
092: void setRootFragment(Fragment fragment);
093:
094: /**
095: * Retrieves the fragment contained within this page, with the
096: * specified Id.
097: *
098: * @param id the fragment id to look for
099: * @return the found Fragment object or null if not found
100: */
101: Fragment getFragmentById(String id);
102:
103: /**
104: * Removes the fragment contained within this page, with the
105: * specified Id.
106: *
107: * @param id the fragment id to remove
108: * @return the removed Fragment object or null if not found
109: */
110: Fragment removeFragmentById(String id);
111:
112: /**
113: * Retrieves the fragments contained within this page, with the
114: * specified name.
115: *
116: * @param name the fragment name to look for
117: * @return the list of found Fragment objects or null if not found
118: */
119: List getFragmentsByName(String name);
120:
121: /**
122: * getMenuDefinitions - get list of menu definitions
123: *
124: * @return definition list
125: */
126: List getMenuDefinitions();
127:
128: /**
129: * newMenuDefinition - creates a new empty menu definition
130: *
131: * @return a newly created MenuDefinition object for use in Page
132: */
133: MenuDefinition newMenuDefinition();
134:
135: /**
136: * newMenuExcludeDefinition - creates a new empty menu exclude definition
137: *
138: * @return a newly created MenuExcludeDefinition object for use in Page
139: */
140: MenuExcludeDefinition newMenuExcludeDefinition();
141:
142: /**
143: * newMenuIncludeDefinition - creates a new empty menu include definition
144: *
145: * @return a newly created MenuIncludeDefinition object for use in Page
146: */
147: MenuIncludeDefinition newMenuIncludeDefinition();
148:
149: /**
150: * newMenuOptionsDefinition - creates a new empty menu options definition
151: *
152: * @return a newly created MenuOptionsDefinition object for use in Page
153: */
154: MenuOptionsDefinition newMenuOptionsDefinition();
155:
156: /**
157: * newMenuSeparatorDefinition - creates a new empty menu separator definition
158: *
159: * @return a newly created MenuSeparatorDefinition object for use in Page
160: */
161: MenuSeparatorDefinition newMenuSeparatorDefinition();
162:
163: /**
164: * setMenuDefinitions - set list of menu definitions
165: *
166: * @param definitions definition list
167: */
168: void setMenuDefinitions(List definitions);
169: }
|