📄 cmsresourcetypepage.java
字号:
/*
* File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/legacy/CmsResourceTypePage.java,v $
* Date : $Date: 2006/03/27 14:53:03 $
* Version: $Revision: 1.9 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (C) 2002 Alkacon Software (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.opencms.legacy;
import org.opencms.configuration.CmsConfigurationException;
import org.opencms.db.CmsSecurityManager;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsResource;
import org.opencms.file.types.A_CmsResourceType;
import org.opencms.file.types.Messages;
import org.opencms.importexport.A_CmsImport;
import org.opencms.main.OpenCms;
import java.util.List;
/**
* Describes the resource type "page".<p>
*
* @author Alexander Kandzior (a.kandzior@alkacon.com)
*
* @version $Revision: 1.9 $
* @since 5.1
*
* @deprecated Will not be supported past the OpenCms 6 release.
*/
public class CmsResourceTypePage extends A_CmsResourceType {
/** The type id of this resource. */
private static final int C_RESOURCE_TYPE_ID = 97;
/** The name of this resource. */
private static final String C_RESOURCE_TYPE_NAME = A_CmsImport.RESOURCE_TYPE_LEGACY_PAGE_NAME;
/** Indicates that the static configuration of the resource type has been frozen. */
private static boolean m_staticFrozen;
/** The static type id of this resource type. */
private static int m_staticTypeId;
/**
* Default constructor, used to initialize member variables.<p>
*/
public CmsResourceTypePage() {
super();
m_typeId = C_RESOURCE_TYPE_ID;
m_typeName = C_RESOURCE_TYPE_NAME;
}
/**
* Returns the static type id of this (default) resource type.<p>
*
* @return the static type id of this (default) resource type
*/
public static int getStaticTypeId() {
return m_staticTypeId;
}
/**
* Returns the static type name of this (default) resource type.<p>
*
* @return the static type name of this (default) resource type
*/
public static String getStaticTypeName() {
return C_RESOURCE_TYPE_NAME;
}
/**
* @see org.opencms.file.types.A_CmsResourceType#createResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, java.lang.String, byte[], java.util.List)
*/
public CmsResource createResource(
CmsObject cms,
CmsSecurityManager securityManager,
String resourcename,
byte[] content,
List properties) {
throw new RuntimeException("createResource(): The resource type 'page' is deprecated and not longer supported!");
}
/**
* @see org.opencms.file.types.I_CmsResourceType#getLoaderId()
*/
public int getLoaderId() {
return CmsXmlTemplateLoader.C_RESOURCE_LOADER_ID;
}
/**
* @see org.opencms.file.types.A_CmsResourceType#initConfiguration(java.lang.String, java.lang.String, String)
*/
public void initConfiguration(String name, String id, String className) throws CmsConfigurationException {
if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) {
// configuration already frozen
throw new CmsConfigurationException(org.opencms.configuration.Messages.get().container(
org.opencms.file.types.Messages.ERR_CONFIG_FROZEN_3,
this.getClass().getName(),
getStaticTypeName(),
new Integer(getStaticTypeId())));
}
if (!C_RESOURCE_TYPE_NAME.equals(name)) {
// default resource type MUST have default name
throw new CmsConfigurationException(Messages.get().container(
Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3,
this.getClass().getName(),
C_RESOURCE_TYPE_NAME,
name));
}
// freeze the configuration
m_staticFrozen = true;
super.initConfiguration(C_RESOURCE_TYPE_NAME, id, className);
// set static members with values from the configuration
m_staticTypeId = m_typeId;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -