KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > workplace > CmsExplorerShowResource


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/workplace/CmsExplorerShowResource.java,v $
3 * Date : $Date: 2005/05/19 08:57:22 $
4 * Version: $Revision: 1.2 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29
30 package com.opencms.workplace;
31
32 import org.opencms.file.CmsObject;
33 import org.opencms.main.CmsException;
34 import org.opencms.main.OpenCms;
35
36 import com.opencms.legacy.CmsLegacyException;
37 import com.opencms.legacy.CmsXmlTemplateLoader;
38
39 import java.io.IOException JavaDoc;
40 import java.util.Hashtable JavaDoc;
41
42 /**
43  * Common template class for displaying ressource after preview in Explorer.
44  *
45  * @deprecated Will not be supported past the OpenCms 6 release.
46  */

47
48 public class CmsExplorerShowResource extends CmsWorkplaceDefault {
49
50     /**
51      * Gets the content of a defined section in a given template file and its subtemplates
52      * with the given parameters.
53      *
54      * @see #getContent(CmsObject, String, String, Hashtable, String)
55      * @param cms CmsObject Object for accessing system resources.
56      * @param templateFile Filename of the template file.
57      * @param elementName Element name of this template in our parent template.
58      * @param parameters Hashtable with all template class parameters.
59      * @param templateSelector template section that should be processed.
60      */

61
62     public byte[] getContent(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName, Hashtable JavaDoc parameters, String JavaDoc templateSelector) throws CmsException {
63         String JavaDoc url = (String JavaDoc)parameters.get("url");
64         url = OpenCms.getLinkManager().substituteLink(cms, url.substring(CmsXmlTemplateLoader.getRequest(cms.getRequestContext()).getServletUrl().length()));
65         try {
66             CmsXmlTemplateLoader.getResponse(cms.getRequestContext()).sendRedirect(url);
67         } catch(IOException JavaDoc exc) {
68             throw new CmsLegacyException(exc.getMessage(), exc);
69         }
70         return "".getBytes();
71     }
72
73
74 }
75
Popular Tags