1 31 32 package org.opencms.file.types; 33 34 import org.opencms.configuration.CmsConfigurationException; 35 import org.opencms.loader.CmsDumpLoader; 36 import org.opencms.main.OpenCms; 37 38 47 public class CmsResourceTypePlain extends A_CmsResourceType { 48 49 50 private static final int RESOURCE_TYPE_ID = 1; 51 52 53 private static final String RESOURCE_TYPE_NAME = "plain"; 54 55 56 private static boolean m_staticFrozen; 57 58 59 private static int m_staticTypeId; 60 61 64 public CmsResourceTypePlain() { 65 66 super(); 67 m_typeId = RESOURCE_TYPE_ID; 68 m_typeName = RESOURCE_TYPE_NAME; 69 } 70 71 76 public static int getStaticTypeId() { 77 78 return m_staticTypeId; 79 } 80 81 86 public static String getStaticTypeName() { 87 88 return RESOURCE_TYPE_NAME; 89 } 90 91 97 public String getCachePropertyDefault() { 98 99 return "always;"; 100 } 101 102 105 public int getLoaderId() { 106 107 return CmsDumpLoader.RESOURCE_LOADER_ID; 108 } 109 110 113 public void initConfiguration(String name, String id, String className) throws CmsConfigurationException { 114 115 if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) { 116 throw new CmsConfigurationException(Messages.get().container( 118 Messages.ERR_CONFIG_FROZEN_3, 119 this.getClass().getName(), 120 getStaticTypeName(), 121 new Integer (getStaticTypeId()))); 122 } 123 124 if (!RESOURCE_TYPE_NAME.equals(name)) { 125 throw new CmsConfigurationException(Messages.get().container( 127 Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3, 128 this.getClass().getName(), 129 RESOURCE_TYPE_NAME, 130 name)); 131 } 132 133 m_staticFrozen = true; 135 136 super.initConfiguration(RESOURCE_TYPE_NAME, id, className); 137 m_staticTypeId = m_typeId; 139 } 140 } | Popular Tags |