1 31 32 package org.opencms.xml.content; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.main.CmsException; 36 import org.opencms.main.CmsLog; 37 import org.opencms.xml.CmsXmlContentDefinition; 38 import org.opencms.xml.types.I_CmsXmlContentValue; 39 40 import org.apache.commons.logging.Log; 41 42 54 class CmsXmlContentMappingVisitor implements I_CmsXmlContentValueVisitor { 55 56 57 private static final Log LOG = CmsLog.getLog(CmsXmlContentMappingVisitor.class); 58 59 60 CmsObject m_cms; 61 62 63 CmsXmlContent m_content; 64 65 66 CmsXmlContentDefinition m_definition; 67 68 69 CmsXmlContentErrorHandler m_errorHandler; 70 71 77 public CmsXmlContentMappingVisitor(CmsObject cms, CmsXmlContent content) { 78 79 m_cms = cms; 81 m_content = content; 82 m_definition = content.getContentDefinition(); 83 } 84 85 90 public CmsXmlContentErrorHandler getErrorHandler() { 91 92 return m_errorHandler; 93 } 94 95 98 public void visit(I_CmsXmlContentValue value) { 99 100 if (LOG.isDebugEnabled()) { 101 LOG.debug(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_VISIT_1, value.getPath())); 102 } 103 104 try { 105 m_definition.getContentHandler().resolveMapping(m_cms, m_content, value); 106 } catch (CmsException e) { 107 LOG.error(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_RESOLVE_MAPPING_1, value.getPath()), e); 108 } 109 } 110 } | Popular Tags |