View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      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.decoration;
18  
19  import java.util.Collection;
20  import java.util.Set;
21  
22  import org.apache.jetspeed.om.page.Fragment;
23  import org.apache.jetspeed.om.page.Page;
24  import org.apache.jetspeed.request.RequestContext;
25  
26  /***
27   * Theme provides a simple aggregation of all of the decorations
28   * within the current "page."
29   * 
30   * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
31   *
32   */
33  public interface Theme 
34  {
35      /***
36       * 
37       * @return Set of all of the stylesheets needed to properly
38       * render of the decorations in this theme.
39       */
40      Set getStyleSheets();
41      
42      /***
43       * Returns a a Decoration for the requested fragment.
44       * 
45       * @param fragment whose decoration we want to retrieve.
46       * @return Decroration for this fragment.
47       * 
48       * @see Decoration
49       * @see Fragment
50       */
51      Decoration getDecoration(Fragment fragment);
52      
53      /***
54       * Get a list of portlet decoration names used by 
55       * portlets on the current page.
56       * 
57       * @return unmodifiable list for portlet decoration names.
58       * 
59       * @see Decoration
60       * @see Fragment
61       */
62      Collection getPortletDecorationNames();
63      
64      
65      /***
66       * Returns the the top most, "root" layout fragment's
67       * decoration. 
68       * 
69       * @return the the top most, "root" layout fragment's
70       * decoration. 
71       */
72      LayoutDecoration getPageLayoutDecoration();
73      
74      /***
75       * Initialize a page theme
76       * 
77       * @param context
78       */
79      void init(Page page, DecorationFactory decoration, RequestContext context);
80      
81      boolean isInvalidated();
82      
83      void setInvalidated(boolean flag);
84  }