|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
PortletHomeService.java | 100% | 100% | 100% | 100% |
|
1 |
// Copyright 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12 |
// See the License for the specific language governing permissions and
|
|
13 |
// limitations under the License.
|
|
14 |
|
|
15 |
package org.apache.tapestry.portlet;
|
|
16 |
|
|
17 |
import java.io.IOException;
|
|
18 |
|
|
19 |
import org.apache.tapestry.IRequestCycle;
|
|
20 |
import org.apache.tapestry.engine.HomeService;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Replacement for the standard home service, used by Portlets. This exists to handle the special
|
|
24 |
* case where a Portlet render request arrives when there is not a Portlet action request prior ...
|
|
25 |
* this can happen when a Portlet is first added to a Portal page.
|
|
26 |
*
|
|
27 |
* @author Howard M. Lewis Ship
|
|
28 |
* @since 4.0
|
|
29 |
*/
|
|
30 |
public class PortletHomeService extends HomeService |
|
31 |
{ |
|
32 |
private PortletRenderer _portletRenderer;
|
|
33 |
|
|
34 |
private PortletRequestGlobals _requestGlobals;
|
|
35 |
|
|
36 | 2 |
public void service(IRequestCycle cycle) throws IOException |
37 |
{ |
|
38 | 2 |
if (_requestGlobals.isRenderRequest())
|
39 |
{ |
|
40 | 1 |
String pageName = getPageName(); |
41 |
|
|
42 | 1 |
_portletRenderer.renderPage(cycle, pageName); |
43 |
|
|
44 | 1 |
return;
|
45 |
} |
|
46 |
|
|
47 | 1 |
super.service(cycle);
|
48 |
} |
|
49 |
|
|
50 | 1 |
public void setPortletRenderer(PortletRenderer portletRenderer) |
51 |
{ |
|
52 | 1 |
_portletRenderer = portletRenderer; |
53 |
} |
|
54 |
|
|
55 | 2 |
public void setRequestGlobals(PortletRequestGlobals requestGlobals) |
56 |
{ |
|
57 | 2 |
_requestGlobals = requestGlobals; |
58 |
} |
|
59 |
} |
|