KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > services > pageregistry > PageRegistry


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
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 final 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 JavaDoc 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 JavaDoc{
64         cService.addFragment(fragment);
65     }
66 }
67
Popular Tags