/** * Once the proxy has been constructed the runtime passes in * the information associated with the reference that the proxy * represents * * @param SCA_ReferenceType $reference_type Reference type * * @return null */ public function addReferenceType(SCA_ReferenceType $reference_type) { $this->reference_type = $reference_type; // If there are type descriptions create and XML DAS and add them if (count($reference_type->getTypes()) > 0) { // Some XSD types are specified with the reference // annotation so use these XSDs to build the XML DAS $this->xml_das = $reference_type->getXmlDas(); // get the list of types that have been loaded into // the XML DAS $this->type_list = SCA_Helper::getAllXmlDasTypes($this->xml_das); } else { // No XSDs are specified so we assume that XML strings // are passed in instead of SDOs } }
/** * TODO - We need to think about where to put this method but I need the * SMD file and access to the references so here will have to * do fo now. I want a cleaner abstraction of JsonRpcClient and * JsonProxy. * * @param SCA_ReferenceType $reference_type Reference type * * @return null */ public function addReferenceType(SCA_ReferenceType $reference_type) { $this->reference_type = $reference_type; // Add type descriptions to the Json DAS. We use XSDs if they // are prvoided. If not we used the SMD and assume the default // namespace provided by the JSON DAS if (count($reference_type->getTypes()) > 0) { // Some XSD types are specified with the reference // annotation so use these XSDs to build the JSON DAS $this->json_das = $this->getJsonDas($reference_type->getTypes(), $reference_type->getClassName()); // get the list of types that have been loaded into // the JSON DAS in this case $this->type_list = SCA_Helper::getAllXmlDasTypes($this->json_das->getXmlDas()); } else { // No XSDs are specified with the reference annotation // so use the SMD to build the JSON DAS $this->json_das = new SDO_DAS_Json(); $this->json_das->addTypesSmdString($this->smd_file); } }
/** * TODO - We need to think about where to put this method * * @param SCA_ReferenceType $reference_type Reference Type * * @return null */ public function addReferenceType(SCA_ReferenceType $reference_type) { SCA::$logger->log("Entering"); $this->reference_type = $reference_type; // Add type descriptions to the XML DAS. We use XSDs if they // are prvoided. if (count($reference_type->getTypes()) > 0) { // Some XSD types are specified with the reference // annotation so use these XSDs to build the XMLDAS $this->xmldas = $reference_type->getXmlDas(); // get the list of types that have been loaded into // the XMLDAS in this case $this->type_list = SCA_Helper::getAllXmlDasTypes($this->xmldas); } else { //TODO: This is where we end up if we don't specify @types on a client side atom component with an @reference! //TODO: refactor this and check routes to this part of the code result in proper response $this->xmldas = SDO_DAS_XML::create(dirname(__FILE__) . '/Atom1.0.xsd'); } }
/** * Create XMLRPCDAS * * @param SCA_ReferenceType $reference_type Reference type * * @return object */ protected function createXmlRpcDas($reference_type) { $xsds = $reference_type->getTypes(); $xmlrpc_das = new SCA_Bindings_Xmlrpc_DAS(); foreach ($xsds as $index => $xsds) { list($namespace, $xsdfile) = $xsds; if (SCA_Helper::isARelativePath($xsdfile)) { $xsd = SCA_Helper::constructAbsolutePath($xsdfile, $reference_type->getClassName()); $xmlrpc_das->addTypesXsdFile($xsd); } } return $xmlrpc_das; }