01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.jetspeed.om.page;
18:
19: import java.util.List;
20:
21: /**
22: * PageFragment is a volatile wrapper around a
23: * {@link org.apache.jetspeed.om.page.Page} metadata
24: * object for use in rendering. As with
25: * the {@link org.apache.jetspeed.om.page.Fragment} object,
26: * <code>Page</code> objects are persistent, single-instance
27: * metadata objects that should not be used to hold per-request
28: * content. ContentPage solves this by providing a thin, wrapper
29: * interface that can be used for rendering requested content associated
30: * with the wrapped page relative to the currect user-request.
31: *
32: * @author weaver@apache.org
33: *
34: */
35: public interface ContentPage extends Page {
36: /**
37: * Provides access to a per-request safe ContentFragment.
38: * ContentFragments add the additional ability to temporarily
39: * store rendered content of the current request along with
40: * original, persistent metadata of the Fragment itself.
41: *
42: * @return ContentFragment wrapping the actual root Fragment.
43: */
44: ContentFragment getRootContentFragment();
45:
46: void setRootContentFragment(ContentFragment frag);
47:
48: /**
49: * Returns a ContentFragment that wraps the actual
50: * Fragment metadata represented by the id argument.
51: * @param id unique id of the Fragment we want to retrieve.
52: * @return
53: */
54: ContentFragment getContentFragmentById(String id);
55:
56: /**
57: * Returns a list of ContentFragment that wrap the actual
58: * Fragment metadata represented by the name argument.
59: * @param name name of the Fragments we want to retrieve.
60: * @return
61: */
62: List getContentFragmentsByName(String name);
63:
64: /**
65: * Overridden to to indicate that the {@link Fragment} returned
66: * must also be an instance of ContentFragment.
67: *
68: * @param id the fragment id to look for
69: * @return the found ContentFragment object or null if not found
70: */
71: Fragment getFragmentById(String id);
72:
73: /**
74: * Overridden to to indicate that the list of {@link Fragment}
75: * instances returned must also be instances of ContentFragment.
76: *
77: * @param name the fragments name to look for
78: * @return the list of found ContentFragment object or null if not found
79: */
80: List getFragmentsByName(String name);
81:
82: /**
83: * Overridden to to indicate that the {@link Fragment} returned
84: * must also be an instance of ContentFragment.
85: *
86: * @return the base Fragment object for this page.
87: */
88: Fragment getRootFragment();
89: }
|