void getAllExtensions( OutputIterator & output ) const { Runtime * rntm( Runtime::getDefault() ); for( Runtime::ExtensionIterator i = rntm->extensionsBegin(); i != rntm->extensionsEnd(); ++i ) { ::boost::shared_ptr< Extension > extension( *i ); if( extension->getPoint() == m_id && extension->isEnable() == true && extension->validate() == Extension::Valid ) { *output = extension; ++output; } } }
Extension::Validity Extension::validate() { // Skips the validation if already done. if( m_validity != UnknownValidity ) { return m_validity; } // Retrieves the extension point. Runtime * rntm( Runtime::getDefault() ); ::boost::shared_ptr< ExtensionPoint > point( rntm->findExtensionPoint(m_point) ); // Checks that the point exists. if( !point ) { throw RuntimeException(m_point + " : invalid point reference."); } // Validates the extension. ::boost::shared_ptr< io::Validator > validator( point->getExtensionValidator() ); OSLM_ASSERT("Sorry, validator creation failed for point "<<point->getIdentifier(), validator ); // Check extension XML Node <extension id="xxx" implements="yyy" >...</extension> validator->clearErrorLog(); if( validator->validate( m_xmlNode ) == true ) { m_validity = Valid; } else { m_validity = Invalid; const std::string identifier = m_id.empty() ? "anonymous" : m_id; OSLM_ERROR("In bundle " << getBundle()->getIdentifier() << ". " << identifier << ": invalid extension XML element node does not respect schema. Verification error log is : " << std::endl << validator->getErrorLog() ); } return m_validity; }