1 31 32 package org.opencms.file.types; 33 34 import org.opencms.configuration.CmsConfigurationException; 35 import org.opencms.loader.CmsJspLoader; 36 import org.opencms.main.OpenCms; 37 38 53 public class CmsResourceTypeJsp extends A_CmsResourceType { 54 55 56 private static final int RESOURCE_TYPE_ID = 4; 57 58 59 private static final String RESOURCE_TYPE_NAME = "jsp"; 60 61 62 private static boolean m_staticFrozen; 63 64 65 private static int m_staticTypeId; 66 67 70 public CmsResourceTypeJsp() { 71 72 super(); 73 m_typeId = RESOURCE_TYPE_ID; 74 m_typeName = RESOURCE_TYPE_NAME; 75 } 76 77 82 public static int getStaticTypeId() { 83 84 return m_staticTypeId; 85 } 86 87 92 public static String getStaticTypeName() { 93 94 return RESOURCE_TYPE_NAME; 95 } 96 97 100 public int getLoaderId() { 101 102 return CmsJspLoader.RESOURCE_LOADER_ID; 103 } 104 105 108 public void initConfiguration(String name, String id, String className) throws CmsConfigurationException { 109 110 if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) { 111 throw new CmsConfigurationException(Messages.get().container( 113 Messages.ERR_CONFIG_FROZEN_3, 114 this.getClass().getName(), 115 getStaticTypeName(), 116 new Integer (getStaticTypeId()))); 117 } 118 119 if (!RESOURCE_TYPE_NAME.equals(name)) { 120 throw new CmsConfigurationException(Messages.get().container( 122 Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3, 123 this.getClass().getName(), 124 RESOURCE_TYPE_NAME, 125 name)); 126 } 127 128 m_staticFrozen = true; 130 131 super.initConfiguration(RESOURCE_TYPE_NAME, id, className); 132 m_staticTypeId = m_typeId; 134 } 135 } | Popular Tags |