View Javadoc

1   /*
2    * Copyright 2000-2001,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  package org.apache.jetspeed.services.portaltoolkit;
18  
19  //jetspeed stuff
20  import org.apache.jetspeed.portal.PortletSet;
21  import org.apache.jetspeed.portal.PortletSkin;
22  import org.apache.jetspeed.portal.PortletControl;
23  import org.apache.jetspeed.portal.PortletController;
24  import org.apache.jetspeed.om.profile.Control;
25  import org.apache.jetspeed.om.profile.Controller;
26  import org.apache.jetspeed.om.profile.Portlets;
27  import org.apache.jetspeed.om.profile.Skin;
28  import org.apache.turbine.services.Service;
29  import org.apache.jetspeed.om.SecurityReference;
30  import org.apache.jetspeed.om.profile.Profile;
31  
32  /***
33   * This service is a Factory for creating new Portal objects from
34   * named Registry entries or PSML configuration entries.
35   * It handles all the portal specific objects except Portlet which are 
36   * handled by a separate PortletFactory service
37   * 
38   * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
39   * @version $Id: PortalToolkitService.java,v 1.5 2004/02/23 03:34:14 jford Exp $
40   */
41  public interface PortalToolkitService extends Service
42  {
43  
44      /*** The default control to use when none is specified */
45      public String SERVICE_NAME = "PortalToolkit";
46              
47      /***
48       * Instanciates a PortletControl based on a Registry entry, if available 
49       * or directly from a classname.
50       *
51       * @param name a PortletControl name available in the registry or a classname
52       * @return the created PortletControl
53       */
54      public PortletControl getControl( String name );
55  
56      /***
57       * Instanciates a PortletControl based on a PSML Control object
58       *
59       * @param control the PSML control object
60       * @return the created PortletControl
61       */
62      public PortletControl getControl( Control control );
63  
64      /***
65       * Instanciates a PortletController based on a Registry entry, if available 
66       * or directly from a classname.
67       *
68       * @param name a PortletController name available in the registry or a classname
69       * @return the created PortletController
70       */
71      public PortletController getController( String name );
72  
73      /***
74       * Instanciates a PortletController based on a PSML Controller object
75       *
76       * @param control the PSML controller object
77       * @return the created PortletController
78       */
79      public PortletController getController( Controller controller );
80  
81      /***
82       * Create a PortletSkin object based on a Registry entry if available
83       *
84       * @param name the skin name in the Registry
85       * @return the new PortletSkin object
86       */
87      public PortletSkin getSkin( String name );
88  
89      /***
90       * Create a PortletSkin object based on PSML skin description
91       *
92       * @param skin the PSML Skin object
93       * @return the new PortletSkin object
94       */
95      public PortletSkin getSkin( Skin skin );
96  
97      /***
98       * Creates a PortletSet from a PSML portlets description
99       *
100      * @param portlets the PSML portlet set description
101      * @return a new instance of PortletSet
102      */
103     public PortletSet getSet( Portlets portlets );
104 
105 
106     /***
107      * Given a locator String path, returns a Portlets collecton
108      *
109      * @param locatorPath ProfileLocator resource path identifier
110      * @return a portlets collection from the PSML resource
111      */
112     public Portlets getReference(String locatorPath);
113 
114     /***
115      * Gets default security ref based on the profile type (user|role|group). Returns
116      * null if no default is defined.
117      * 
118      * @param profile
119      * @return default security reference
120      */
121     public SecurityReference getDefaultSecurityRef(Profile profile);
122 
123     /***
124      * Gets default security ref based on the profile type (user|role|group). Returns
125      * null if no default is defined.
126      *
127      * @param type of entity to return default security ref for
128      * @return default security reference
129      */
130     public SecurityReference getDefaultSecurityRef(String type);
131 
132 }
133