View Javadoc

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.aggregation;
21  
22  import java.io.IOException;
23  import java.util.Collection;
24  
25  import javax.servlet.ServletException;
26  import javax.servlet.http.HttpServletRequest;
27  import javax.servlet.http.HttpServletResponse;
28  
29  import org.apache.pluto.portalImpl.aggregation.navigation.Navigation;
30  import org.apache.pluto.portalImpl.core.PortalURL;
31  import org.apache.pluto.portalImpl.util.Parameters;
32  
33  public interface Fragment
34  {
35  
36  
37      /***
38       * Is called to render the fragment. This may be a page, column or 
39       * even a portlet.
40       * 
41       * @param request  the servlet request
42       * @param response the servlet response
43       * @exception ServletException
44       * @exception IOException
45       */
46      public void service(HttpServletRequest request, HttpServletResponse response)
47          throws ServletException, IOException;
48  
49      /***
50       * Returns the identifier of this fragment. Mostly this is a name visible
51       * in the Portal URL.
52       * 
53       * @return the identifier of this fragment
54       */
55      public String getId();
56  
57      /***
58       * Returns the parent fragment. If this fragment is the root fragment
59       * the return value is NULL
60       * 
61       * @return the parent fragment or NULL if this is the root fragment
62       */
63      public Fragment getParent();
64  
65      /***
66       * Returns the initialization parameters of this fragment
67       * 
68       * @return the init parameters
69       */
70      public Parameters getInitParameters();
71  
72      /***
73       * Returns a collection of all child fragments
74       * 
75       * @return a collection containing objects implementing the interface fragment
76       */
77      public Collection getChildFragments();
78  
79      /***
80       * Adds an child to the fragment
81       * 
82       * @param child  the child fragment
83       */
84      public void addChild(Fragment child);
85  
86      /***
87       * Returns the navigational information linked with this fragment.
88       * The return value may be NULL, if no navigational information is defined.
89       * 
90       * @return the navigational information
91       */
92      public Navigation getNavigation();
93  
94      /***
95       * Creates an URL pointing to this fragment
96       * 
97       * @param url the PortalURL object used 
98       */
99      public void createURL(PortalURL url);
100 
101     /***
102      * Returns true if the fragment is part of the URL
103      * 
104      * @param url    the PortalURL object used
105      * @return true if the fragment is part of the URL
106      */
107     public boolean isPartOfURL(PortalURL url);
108 
109 }