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