تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بعد انتهاء العملية بنجاح واستخراج المورد
من استجابة العملية المكتملة، تكون جاهزًا لتنزيل الملف المضغوط
يحتوي على ملفات SDF التي تم إنشاؤها باستخدام media.download
.
إليك مثال على كيفية استخدام مكتبة برامج لتنزيل الملف الناتج:
Java
// Extract download file resource name to use in download requestStringdownloadResourceName=operationResponse.getResponse().get("resourceName").toString();// Configure the Media.download requestMedia.DownloaddownloadRequest=service.media().download(downloadResourceName);// Create output stream for downloaded fileFileOutputStreamoutStream=newFileOutputStream(output-file);// Download filedownloadRequest.executeMediaAndDownloadTo(outStream);System.out.printf("File downloaded to %s\n",outputFile);
Python
# Extract download file resource name to use in download requestresourceName=operation["response"]["resourceName"]# Configure the Media.download requestdownloadRequest=service.media().download_media(resourceName=resourceName)# Create output stream for downloaded fileoutStream=io.FileIO(output-file,mode='wb')# Make downloader objectdownloader=googleHttp.MediaIoBaseDownload(outStream,downloadRequest)# Download media file in chunks until finisheddownload_finished=Falsewhiledownload_finishedisFalse:_,download_finished=downloader.next_chunk()print("File downloaded to %s"%output-file)
PHP
// Get client and set defer so it doesn't immediately return.$client = $this->service->getClient();$client->setDefer(true);// Build media download request.$request = $this->service->media->download( $operation->getResponse()['resourceName'], array('alt' => 'media'));// Call the API, getting the generated SDF.$response = $client->execute($request);$responseBody = $response->getBody();// Writes the downloaded file. If the file already exists, it is// overwritten.file_put_contents(output-file, $responseBody);$client->setDefer(false);printf('File saved to: %s\n', output-file);
بعد تنزيل الملف وفك ضغطه، تصبح ملفات البيانات المنظَّمة التي تم إنشاؤها
متاحة لك. الملفات التي تم إنشاؤها ستكون لها أسماء عامة.
لتحديد نوع ملف SDF (مثال: SDF-LineItems.csv)
الملفات التي تم تخطّيها
إذا تعذّر تضمين بيانات المورد المطلوب في
ملف بيانات منظمة، قد يتضمن الملف المضغوط الذي تم تنزيله ملف "تم تخطيه" الملف
(مثال: SDF-LineItems-Skipped.csv) سيحتوي هذا الملف على عمودين
البيانات الأولى التي تحتوي على معرّفات الموارد التي يتعذر
والسبب الثاني الذي يحتوي على سبب استبعادهم.
قد يتم تخطّي الموارد لعدة أسباب، بما في ذلك عدم توافقها مع المحتوى.
الحالة أو نوعها غير متوافق. تجنب تخطي الموارد باستخدام
أحدث إصدار من SDF.
تاريخ التعديل الأخير: 2024-09-11 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-09-11 (حسب التوقيت العالمي المتفَّق عليه)"],[[["After a successful operation, download the generated SDFs as a zip file using the `media.download` method, ensuring the `alt` parameter is set to `media`."],["Client libraries simplify the download process, but if using a direct download URL, append `?alt=media` to ensure proper data format."],["Extract the download file resource name from the operation response to initiate the download using your preferred client library (Java, Python, or PHP examples provided)."],["Downloaded zip files contain generically named SDF files; a \"Skipped\" file might be included if certain resources could not be processed, detailing the reasons for exclusion."],["Minimize skipped resources by utilizing the latest SDF version to ensure compatibility and support for your resource types and states."]]],["After a successful operation, extract the `resourceName` to download a zip file containing generated SDFs. Use the `media.download` method with `alt=media` to specify the data format. Client libraries automate this process. Download the file by configuring a `Media.Download` request, creating an output stream, and executing the request to download the file into the stream. The zip file contains structured data files like `SDF-LineItems.csv`. A `Skipped.csv` file might be included, listing resources not included and why.\n"]]