protected function subCompile(core_kernel_classes_Resource $resource) {
        $compilerClass = $this->getSubCompilerClass($resource);
        if (!class_exists($compilerClass)) {
            common_Logger::e('Class '.$compilerClass.' not found while instanciating Compiler');
            return $this->fail(__('%s is of a type that cannot be published', $resource->getLabel()));
        }
        if (!is_subclass_of($compilerClass, __CLASS__)) {
            common_Logger::e('Compiler class '.$compilerClass.' is not a compiler');
            return $this->fail(__('%s is of a type that cannot be published', $resource->getLabel()));
        }
        /** @var $compiler tao_models_classes_Compiler */
        $compiler = new $compilerClass($resource, $this->getStorage());
        $compiler->setServiceLocator($this->getServiceLocator());
        $compiler->setContext($this->getContext());
        $report = $compiler->compile();
        return $report;
    }