1 31 32 package com.opencms.legacy; 33 34 import org.opencms.configuration.CmsConfigurationException; 35 import org.opencms.db.CmsSecurityManager; 36 import org.opencms.file.CmsObject; 37 import org.opencms.file.CmsResource; 38 import org.opencms.file.types.A_CmsResourceType; 39 import org.opencms.file.types.Messages; 40 import org.opencms.loader.CmsDumpLoader; 41 import org.opencms.main.OpenCms; 42 43 import java.util.List ; 44 45 54 public class CmsResourceTypeCompatiblePlain extends A_CmsResourceType { 55 56 57 private static final int C_RESOURCE_TYPE_ID = 98; 58 59 60 private static final String C_RESOURCE_TYPE_NAME = "compatiblePlain"; 61 62 63 private static boolean m_staticFrozen; 64 65 66 private static int m_staticTypeId; 67 68 71 public CmsResourceTypeCompatiblePlain() { 72 73 super(); 74 m_typeId = C_RESOURCE_TYPE_ID; 75 m_typeName = C_RESOURCE_TYPE_NAME; 76 } 77 78 83 public static int getStaticTypeId() { 84 85 return m_staticTypeId; 86 } 87 88 93 public static String getStaticTypeName() { 94 95 return C_RESOURCE_TYPE_NAME; 96 } 97 98 101 public CmsResource createResource( 102 CmsObject cms, 103 CmsSecurityManager securityManager, 104 String resourcename, 105 byte[] content, 106 List properties) { 107 108 throw new RuntimeException ( 109 "createResource(): The resource type 'compatiblePlain' is deprecated and not longer supported"); 110 } 111 112 115 public int getLoaderId() { 116 117 return CmsDumpLoader.RESOURCE_LOADER_ID; 118 } 119 120 123 public void initConfiguration(String name, String id, String className) throws CmsConfigurationException { 124 125 if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) { 126 throw new CmsConfigurationException(org.opencms.configuration.Messages.get().container( 128 org.opencms.file.types.Messages.ERR_CONFIG_FROZEN_3, 129 this.getClass().getName(), 130 getStaticTypeName(), 131 new Integer (getStaticTypeId()))); 132 } 133 134 if (!C_RESOURCE_TYPE_NAME.equals(name)) { 135 throw new CmsConfigurationException(Messages.get().container( 137 Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3, 138 this.getClass().getName(), 139 C_RESOURCE_TYPE_NAME, 140 name)); 141 } 142 143 m_staticFrozen = true; 145 146 super.initConfiguration(C_RESOURCE_TYPE_NAME, id, className); 147 m_staticTypeId = m_typeId; 149 } 150 }
| Popular Tags
|