function globallink_download_target_resource in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.7 gl_ws/gl_ws_receive_translations.inc \globallink_download_target_resource()
- 7.6 gl_ws/gl_ws_receive_translations.inc \globallink_download_target_resource()
19 calls to globallink_download_target_resource()
- globallink_block_get_translated_blocks in globallink_block/
globallink_block.inc - Gets number of translated blocks.
- globallink_block_get_translations_for_row_id in globallink_block/
globallink_block_receive.inc - Gets block translations by row ID.
- globallink_block_receive_form in globallink_block/
globallink_block_receive.inc - Builds form to receive a block submission.
- globallink_entity_get_translated_enties in globallink_entity/
globallink_entity.inc - Gets number of translated entities.
- globallink_entity_get_translations_for_row_id in globallink_entity/
globallink_entity_receive.inc - Gets entity translations by row ID.
File
- gl_ws/
gl_ws_receive_translations.inc, line 439
Code
function globallink_download_target_resource($pd_obj, $target_ticket) {
$username = $pd_obj->username;
$password = $pd_obj->password;
$url = $pd_obj->url;
$session_service = new SessionService2(GL_WSDL_PATH . 'SessionService2.wsdl', array(
'location' => $url . '/services/SessionService2',
));
$target_service = new TargetService2(GL_WSDL_PATH . 'TargetService2.wsdl', array(
'location' => $url . '/services/TargetService2',
));
$token = globallink_login($session_service, $username, $password);
$globallink_download_target_resource_request = new downloadTargetResource();
$globallink_download_target_resource_request->targetId = $target_ticket;
$globallink_download_target_resource_request->userId = $token;
$globallink_download_target_resource_response = $target_service
->downloadTargetResource($globallink_download_target_resource_request);
$repository_item = $globallink_download_target_resource_response->return;
$target_content = $repository_item->data->_;
return $target_content;
}