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:
018: package org.apache.jetspeed.om.page;
019:
020: import java.util.List;
021: import java.util.Map;
022:
023: /**
024: * <p>A <code>Fragment</code> is the basic element handled by the aggregation
025: * engine to compose the final portal page. It represents a reserved screen
026: * area whose layout is managed by a specified component.</p>
027: * <p>The component that is responsible for the layout policy of the fragment
028: * is defined by two properties:<p>
029: * <ul>
030: * <li><b>type</b>: defines the general class of layout component, enabling
031: * the engine to retrieve its exact defintion from its component
032: * repository.
033: * </li>
034: * <li><b>name</b>: this is the exact name of the component. This name must
035: * be unique within a portal instance for a specific component type.
036: * </li>
037: * </ul>
038: * <p>In addition to specifying the component responsible for the layout,
039: * the fragment also stores contextual information used for rendering:</p>
040: * <p>Finally the fragment also holds layout and rendering properties that
041: * may be used by a parent fragment to layout all its inner fragments in
042: * an appropriate fashion.</p>
043: *
044: * @version $Id: Fragment.java 516448 2007-03-09 16:25:47Z ate $
045: */
046: public interface Fragment extends BaseElement, java.io.Serializable {
047: /**
048: * A fragment of type PORTLET is considered to be a compliant portlet
049: * in the sense of the JSR 168.
050: */
051: public String PORTLET = "portlet";
052:
053: /**
054: * A fragment of type LAYOUT is a specific JSR 168 compliant portlet
055: * that knows how to layout a Page and depends on the Jetspeed
056: * layout service.
057: */
058: public String LAYOUT = "layout";
059:
060: /**
061: * row standard layout property name
062: */
063: public String ROW_PROPERTY_NAME = "row";
064:
065: /**
066: * column standard layout property name
067: */
068: public String COLUMN_PROPERTY_NAME = "column";
069:
070: /**
071: * sizes standard layout property name
072: */
073: public String SIZES_PROPERTY_NAME = "sizes";
074:
075: /**
076: * x coordinate standard layout property name
077: */
078: public String X_PROPERTY_NAME = "x";
079:
080: /**
081: * y coordinate standard layout property name
082: */
083: public String Y_PROPERTY_NAME = "y";
084:
085: /**
086: * z coordinate standard layout property name
087: */
088: public String Z_PROPERTY_NAME = "z";
089:
090: /**
091: * width standard layout property name
092: */
093: public String WIDTH_PROPERTY_NAME = "width";
094:
095: /**
096: * height standard layout property name
097: */
098: public String HEIGHT_PROPERTY_NAME = "height";
099:
100: /**
101: * Returns the administrative name of this fragment. This name should map
102: * to a component name in the component repository defined by the type
103: * attribute.
104: * If the name is not mapped to any component, the fragment is discarded
105: * from the rendering process, as well as any inner fragment.
106: *
107: * @return the administrative name
108: */
109: public String getName();
110:
111: /**
112: * Binds an administrative name to this fragment
113: *
114: * @param name the administrative name
115: */
116: public void setName(String name);
117:
118: /**
119: * Returns the type of the class bound to this fragment
120: */
121: public String getType();
122:
123: /**
124: * Binds a type to this fragment
125: *
126: * @param type the type
127: */
128: public void setType(String type);
129:
130: /**
131: * Returns the name of the skin associated to this fragment
132: */
133: public String getSkin();
134:
135: /**
136: * Defines the skin for this fragment. This skin should be
137: * known by the portal.
138: *
139: * @param skinName the name of the new skin applied to this fragment
140: */
141: public void setSkin(String skinName);
142:
143: /**
144: * Returns the name of the decorator bound to this fragment
145: */
146: public String getDecorator();
147:
148: /**
149: * Defines the decorator for this fragment. This decorator should be
150: * known by the portal.
151: *
152: * @param decoratorName the name of the decorator applied to this fragment
153: */
154: public void setDecorator(String decoratorName);
155:
156: /**
157: * Returns the display state of this fragment. The state may have the
158: * following values: "Normal","Minimized","Maximized","Hidden"
159: */
160: public String getState();
161:
162: /**
163: * Sets the display state of this fragment.
164: * Valid states are: "Normal","Minimized","Maximized","Hidden"
165: *
166: * @param state the new fragment state
167: */
168: public void setState(String state);
169:
170: /**
171: * Returns the display mode of this fragment. The mode may have the
172: * following values: "View","Edit","Help","Config","Print","Custom"
173: */
174: public String getMode();
175:
176: /**
177: * Sets the display mode of this fragment.
178: * Valid modes are: "View","Edit","Help","Config","Print","Custom"
179: *
180: * @param mode the new fragment mode
181: */
182: public void setMode(String mode);
183:
184: /**
185: * Returns all fragments used in this node. This may be
186: * a page fragment or even directly a portlet fragment
187: *
188: * @return a collection containing Fragment objects
189: */
190: public List getFragments();
191:
192: /**
193: * getProperty
194: *
195: * Get named property value.
196: *
197: * @param propName property name
198: * @return value
199: */
200: public String getProperty(String propName);
201:
202: /**
203: * getIntProperty
204: *
205: * Get named property value as integer.
206: *
207: * @param propName property name
208: * @return int value
209: */
210: public int getIntProperty(String propName);
211:
212: /**
213: * getFloatProperty
214: *
215: * Get named property value as float.
216: *
217: * @param propName property name
218: * @return float value
219: */
220: public float getFloatProperty(String propName);
221:
222: /**
223: * getProperties
224: *
225: * Get writable Map of properties by name.
226: *
227: * @return properties map
228: */
229: public Map getProperties();
230:
231: /**
232: * get layout row property
233: *
234: * @return row layout property
235: **/
236: public int getLayoutRow();
237:
238: /**
239: * set the layout row property
240: *
241: * @param row
242: */
243: public void setLayoutRow(int row);
244:
245: /**
246: * get layout column property
247: *
248: * @return column layout property
249: **/
250: public int getLayoutColumn();
251:
252: /**
253: * set the layout column property
254: *
255: * @param column
256: */
257: public void setLayoutColumn(int column);
258:
259: /**
260: * get layout sizes property, (i.e. "25%,75%")
261: *
262: * @return sizes layout property
263: **/
264: public String getLayoutSizes();
265:
266: /**
267: * set the layout sizes
268: *
269: * @param sizes
270: */
271: public void setLayoutSizes(String sizes);
272:
273: /**
274: * get layout x coordinate property
275: *
276: * @return the x coordinate value
277: **/
278: public float getLayoutX();
279:
280: /**
281: * set the layout x coordinate property
282: *
283: * @param x the coordinate value
284: */
285: public void setLayoutX(float x);
286:
287: /**
288: * get layout y coordinate property
289: *
290: * @return the y coordinate value
291: **/
292: public float getLayoutY();
293:
294: /**
295: * set the layout y coordinate property
296: *
297: * @param y the coordinate value
298: */
299: public void setLayoutY(float y);
300:
301: /**
302: * get layout z coordinate property
303: *
304: * @return the z coordinate value
305: **/
306: public float getLayoutZ();
307:
308: /**
309: * set the layout z coordinate property
310: *
311: * @param z the coordinate value
312: */
313: public void setLayoutZ(float z);
314:
315: /**
316: * get layout width property
317: *
318: * @return the width value
319: **/
320: public float getLayoutWidth();
321:
322: /**
323: * set the layout width property
324: *
325: * @param width the value
326: */
327: public void setLayoutWidth(float width);
328:
329: /**
330: * get layout height property
331: *
332: * @return the height value
333: **/
334: public float getLayoutHeight();
335:
336: /**
337: * set the layout height property
338: *
339: * @param height the value
340: */
341: public void setLayoutHeight(float height);
342:
343: /**
344: * Test if this fragment is actually a reference to an external fragment.
345: *
346: * @return true is this element is a reference
347: */
348: public boolean isReference();
349:
350: /**
351: * Get collection of fragment preference objects used
352: * to initialize user preferences
353: *
354: * @return list of FragmentPreference objects
355: */
356: public List getPreferences();
357:
358: /**
359: * Set collection of fragment preference objects
360: *
361: * @param preferences list of FragmentPreference objects
362: */
363: public void setPreferences(List preferences);
364: }
|