1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.portalImpl.services.pageregistry;
21
22 import org.apache.pluto.portalImpl.aggregation.Fragment;
23 import org.apache.pluto.portalImpl.aggregation.RootFragment;
24 import org.apache.pluto.portalImpl.services.ServiceManager;
25
26 /***
27 * This class is a static accessor for a <code>PageRegistryService</code>
28 * implementation.
29 *
30
31 */
32 public class PageRegistry
33 {
34
35
36 private static PageRegistryService cService =
37 (PageRegistryService) ServiceManager.getService (PageRegistryService.class);
38
39 /***
40 * Returns the description of the complete portal site
41 *
42 * @return the object model description
43 */
44 public static RootFragment getRootFragment()
45 {
46 return cService.getRootFragment();
47 }
48
49 /***
50 * Returns the fragment with the given id
51 *
52 * return the fragment object with this id
53 **/
54 public static Fragment getFragment(String id) {
55 return cService.getFragment(id);
56 }
57
58 /***
59 * Add a fragment to the page registry
60 *
61 * @param fragment the fragment to add
62 **/
63 public static void addFragment(Fragment fragment) throws Exception{
64 cService.addFragment(fragment);
65 }
66
67
68 public static void setRootFragment()
69 {
70 cService = (PageRegistryService) ServiceManager.getService (PageRegistryService.class);
71 }
72 }