KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/workplace/CmsAdminProjectHistory.java,v $
3 * Date : $Date: 2005/05/31 15:51:19 $
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.CmsLog;
35
36 import com.opencms.core.I_CmsSession;
37 import com.opencms.legacy.CmsXmlTemplateLoader;
38 import com.opencms.template.CmsXmlTemplateFile;
39
40 import java.util.Hashtable JavaDoc;
41 import java.util.List JavaDoc;
42
43 /**
44  * Template class for displaying OpenCms workplace admin project history.
45  * <P>
46  *
47  * @author Edna Falkenhan
48  * @version $Revision: 1.2 $ $Date: 2005/05/31 15:51:19 $
49  * @see com.opencms.workplace.CmsXmlWpTemplateFile
50  *
51  * @deprecated Will not be supported past the OpenCms 6 release.
52  */

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

67
68     public byte[] getContent(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName,
69             Hashtable JavaDoc parameters, String JavaDoc templateSelector) throws CmsException {
70         if(CmsLog.getLog(this).isDebugEnabled() && C_DEBUG) {
71             CmsLog.getLog(this).debug("Getting content of element " + ((elementName==null)?"<root>":elementName));
72             CmsLog.getLog(this).debug("Template file is: " + templateFile);
73             CmsLog.getLog(this).debug("Selected template section is: " + ((templateSelector==null)?"<default>":templateSelector));
74         }
75         CmsXmlTemplateFile xmlTemplateDocument = getOwnTemplateFile(cms, templateFile,
76                 elementName, parameters, templateSelector);
77         xmlTemplateDocument.setData("proId", ""+ cms.getRequestContext().currentProject().getId());
78         // delete the oldProjectId
79
I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
80         session.removeValue("oldProjectId");
81         // Now load the template file and start the processing
82
return startProcessing(cms, xmlTemplateDocument, elementName, parameters,
83                 templateSelector);
84     }
85
86     /**
87      * Indicates if the results of this class are cacheable.
88      *
89      * @param cms CmsObject Object for accessing system resources
90      * @param templateFile Filename of the template file
91      * @param elementName Element name of this template in our parent template.
92      * @param parameters Hashtable with all template class parameters.
93      * @param templateSelector template section that should be processed.
94      * @return <EM>true</EM> if cacheable, <EM>false</EM> otherwise.
95      */

96
97     public boolean isCacheable(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName,
98             Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
99         return false;
100     }
101
102     /**
103      * Gets the projects.
104      * <P>
105      *
106      * @param cms CmsObject Object for accessing system resources.
107      * @param names Vector to be filled with the appropriate values in this method.
108      * @param values Vector to be filled with the appropriate values in this method.
109      * @return Vector representing the current projects.
110      * @throws CmsException
111      */

112
113     public List JavaDoc projectList(CmsObject cms, CmsXmlLanguageFile lang) throws CmsException {
114         // get the projects from the history
115
return cms.getAllBackupProjects();
116     }
117 }
118
Popular Tags