01: /*
02: * Copyright 2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: /*
14: * JBoss, Home of Professional Open Source
15: * Copyright 2005, JBoss Inc., and individual contributors as indicated
16: * by the @authors tag. See the copyright.txt in the distribution for a
17: * full listing of individual contributors.
18: *
19: * This is free software; you can redistribute it and/or modify it
20: * under the terms of the GNU Lesser General Public License as
21: * published by the Free Software Foundation; either version 2.1 of
22: * the License, or (at your option) any later version.
23: *
24: * This software is distributed in the hope that it will be useful,
25: * but WITHOUT ANY WARRANTY; without even the implied warranty of
26: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27: * Lesser General Public License for more details.
28: *
29: * You should have received a copy of the GNU Lesser General Public
30: * License along with this software; if not, write to the Free
31: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
32: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
33: */
34: package org.pentaho.ui.portlet.jboss;
35:
36: import java.io.IOException;
37:
38: import javax.portlet.GenericPortlet;
39: import javax.portlet.PortletException;
40: import javax.portlet.PortletRequestDispatcher;
41: import javax.portlet.RenderRequest;
42: import javax.portlet.RenderResponse;
43:
44: import org.apache.commons.logging.Log;
45: import org.apache.commons.logging.LogFactory;
46:
47: /**
48: * TODO: use PageCustomizerInterceptor instead in JBoss Portal 2.6 or greater
49: */
50: public class PentahoPortalNavigationPortlet extends GenericPortlet {
51:
52: private static final Log logger = LogFactory
53: .getLog(PentahoPortalNavigationPortlet.class);
54:
55: public void render(RenderRequest req, RenderResponse resp)
56: throws PortletException, IOException {
57: resp.setContentType("text/html"); //$NON-NLS-1$
58: resp.setTitle("Pentaho Portal Navigation"); //$NON-NLS-1$
59:
60: PortletRequestDispatcher prd = getPortletContext()
61: .getRequestDispatcher("/jsp/catalog/index_p.jsp"); //$NON-NLS-1$
62: try {
63: prd.include(req, resp);
64: } catch (PortletException e) {
65: if (logger.isErrorEnabled()) {
66: logger.error("", e); //$NON-NLS-1$
67: }
68: } catch (IOException e) {
69: if (logger.isErrorEnabled()) {
70: logger.error("", e); //$NON-NLS-1$
71: }
72: }
73:
74: }
75:
76: }
|