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.aggregator.PortletContent;
022: import org.apache.jetspeed.decoration.Decoration;
023:
024: /**
025: *
026: * ContentFragment provides a volatile wrapper interface for
027: * actual {@link org.apache.jetspeed.om.page.Fragment} metadata
028: * objects. Since Fragments are cached and are not request specific
029: * they cannot be used to store request-level content. This is where
030: * we use the <code>ContentFragment</code> to solve this problem.
031: *
032: * @author weaver@apache.org
033: *
034: */
035: public interface ContentFragment extends Fragment {
036: /**
037: * Provides a list of of child ContentFragments that wrap
038: * the actual Fragment metadata objects.
039: * @return
040: */
041: List getContentFragments();
042:
043: /**
044: * Overridden to make it clear to the implemetor the {@link List}
045: * returned <strong>MUST</strong> ContentFragments and not
046: * just regular {@link org.apache.jetspeed.om.page.Fragment}s
047: *
048: * @return a collection containing ContentFragment objects
049: */
050: public List getFragments();
051:
052: /**
053: *
054: * <p>
055: * getRenderedContent
056: * </p>
057: * <p>
058: * Returns the raw,undecorated content of this fragment. If
059: * overridenContent has been set and portlet content has not,
060: * overridden content should be returned.
061: * </p>
062: *
063: * @return The raw,undecorated content of this fragment.
064: * @throws java.lang.IllegalStateException if the content has not yet been set.
065: */
066: public String getRenderedContent() throws IllegalStateException;
067:
068: /**
069: *
070: * <p>
071: * overrideRenderedContent
072: * </p>
073: * <p>
074: * Can be used to store errors that may have occurred during the
075: * rendering process.
076: * </p>
077: *
078: * @param contnent
079: */
080: public void overrideRenderedContent(String contnent);
081:
082: /**
083: * @return the overridden content set by overrideRenderedContent
084: */
085: public String getOverriddenContent();
086:
087: /**
088: *
089: * <p>
090: * setPortletContent
091: * </p>
092: *
093: * @param portletContent
094: */
095: public void setPortletContent(PortletContent portletContent);
096:
097: /**
098: * Retrieves the actual <code>org.apache.jetspeed.decoration.decorator</code>
099: * object for this content fragment.
100: *
101: * TODO: Re-evaluate the naming as this is somewhat confusing
102: * due to the existence of Fragment.getDecorator()
103: * @return
104: */
105: Decoration getDecoration();
106:
107: /**
108: *
109: * @param decoration
110: */
111: void setDecoration(Decoration decoration);
112:
113: /**
114: * Checks if the content is instantly rendered from JPT.
115: */
116: public boolean isInstantlyRendered();
117:
118: }
|