1 31 32 package com.opencms.legacy; 33 34 import org.opencms.configuration.CmsConfigurationException; 35 import org.opencms.file.types.A_CmsResourceType; 36 import org.opencms.file.types.Messages; 37 import org.opencms.main.OpenCms; 38 39 47 public class CmsResourceTypeXMLTemplate extends A_CmsResourceType { 48 49 50 private static final int C_RESOURCE_TYPE_ID = 99; 51 52 53 private static final String C_RESOURCE_TYPE_NAME = "XMLTemplate"; 54 55 56 private static boolean m_staticFrozen; 57 58 59 private static int m_staticTypeId; 60 61 64 public CmsResourceTypeXMLTemplate() { 65 66 super(); 67 m_typeId = C_RESOURCE_TYPE_ID; 68 m_typeName = C_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 C_RESOURCE_TYPE_NAME; 89 } 90 91 94 public int getLoaderId() { 95 96 return CmsXmlTemplateLoader.C_RESOURCE_LOADER_ID; 97 } 98 99 102 public void initConfiguration(String name, String id, String className) throws CmsConfigurationException { 103 104 if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) { 105 throw new CmsConfigurationException(org.opencms.configuration.Messages.get().container( 107 org.opencms.file.types.Messages.ERR_CONFIG_FROZEN_3, 108 this.getClass().getName(), 109 getStaticTypeName(), 110 new Integer (getStaticTypeId()))); 111 } 112 113 if (!C_RESOURCE_TYPE_NAME.equals(name)) { 114 throw new CmsConfigurationException(Messages.get().container( 116 Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3, 117 this.getClass().getName(), 118 C_RESOURCE_TYPE_NAME, 119 name)); 120 } 121 122 m_staticFrozen = true; 124 125 super.initConfiguration(C_RESOURCE_TYPE_NAME, id, className); 126 m_staticTypeId = m_typeId; 128 } 129 }
| Popular Tags
|