Skip to content

Commit 1adf9ec

Browse files
committed
20220418 update : update four api.
1 parent eb2860b commit 1adf9ec

File tree

7 files changed

+134
-47
lines changed

7 files changed

+134
-47
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Packagist Version](https://img.shields.io/packagist/v/aspose/cells-sdk-php) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/aspose/cells-sdk-php) ![Packagist Downloads](https://img.shields.io/packagist/dt/aspose/cells-sdk-php) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-php/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-php/22.3)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Packagist Version](https://img.shields.io/packagist/v/aspose/cells-sdk-php) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/aspose/cells-sdk-php) ![Packagist Downloads](https://img.shields.io/packagist/dt/aspose/cells-sdk-php) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-php/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-php/22.4)
22

33
# PHP SDK for Spreadsheet Processing in Cloud
44

@@ -24,9 +24,13 @@ This Cloud SDK enhances your PHP-based Cloud apps to [process & manipulate Micro
2424
- Fetch the required shape from worksheet.
2525
- Leverage the power of [Pivot Tables](https://docs.aspose.cloud/cells/working-with-pivot-tables/) & Ranges.
2626

27-
## Feature & Enhancements in Version 22.3
27+
## Feature & Enhancements in Version 22.4
28+
29+
- Export API adds extended query parameters.
30+
- Convert API adds extended query parameters.
31+
- SaveAs API adds extended query parameters.
32+
- Get Workbook API adds extended query parameters.
2833

29-
- Add new API about adding digital signature for cloud file.
3034

3135

3236
## Read Other Formats

lib/Api/CellsApi.php

Lines changed: 42 additions & 30 deletions
Large diffs are not rendered by default.

lib/Api/LightCellsApi.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,10 @@ protected function postClearObjectsRequest($file, $objecttype)
12971297
* @throws \InvalidArgumentException
12981298
* @return \Aspose\Cells\Cloud\Model\FilesResult
12991299
*/
1300-
public function postExport($file, $object_type, $format)
1300+
public function postExport($file, $object_type, $format, $extended_query_parameters = null)
13011301
{
13021302
$this->checkAccessToken();
1303-
list($response) = $this->postExportWithHttpInfo($file, $object_type, $format);
1303+
list($response) = $this->postExportWithHttpInfo($file, $object_type, $format, $extended_query_parameters);
13041304
return $response;
13051305
}
13061306

@@ -1315,10 +1315,10 @@ public function postExport($file, $object_type, $format)
13151315
* @throws \InvalidArgumentException
13161316
* @return array of \Aspose\Cells\Cloud\Model\FilesResult, HTTP status code, HTTP response headers (array of strings)
13171317
*/
1318-
public function postExportWithHttpInfo($file, $object_type, $format)
1318+
public function postExportWithHttpInfo($file, $object_type, $format, $extended_query_parameters = null)
13191319
{
13201320
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
1321-
$request = $this->postExportRequest($file, $object_type, $format);
1321+
$request = $this->postExportRequest($file, $object_type, $format, $extended_query_parameters);
13221322

13231323
try {
13241324
$options = $this->createHttpClientOption();
@@ -1391,9 +1391,9 @@ public function postExportWithHttpInfo($file, $object_type, $format)
13911391
* @throws \InvalidArgumentException
13921392
* @return \GuzzleHttp\Promise\PromiseInterface
13931393
*/
1394-
public function postExportAsync($file, $object_type, $format)
1394+
public function postExportAsync($file, $object_type, $format, $extended_query_parameters = null)
13951395
{
1396-
return $this->postExportAsyncWithHttpInfo($file, $object_type, $format)
1396+
return $this->postExportAsyncWithHttpInfo($file, $object_type, $format, $extended_query_parameters)
13971397
->then(
13981398
function ($response) {
13991399
return $response[0];
@@ -1413,10 +1413,10 @@ function ($response) {
14131413
* @throws \InvalidArgumentException
14141414
* @return \GuzzleHttp\Promise\PromiseInterface
14151415
*/
1416-
public function postExportAsyncWithHttpInfo($file, $object_type, $format)
1416+
public function postExportAsyncWithHttpInfo($file, $object_type, $format, $extended_query_parameters = null)
14171417
{
14181418
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
1419-
$request = $this->postExportRequest($file, $object_type, $format);
1419+
$request = $this->postExportRequest($file, $object_type, $format, $extended_query_parameters);
14201420

14211421
return $this->client
14221422
->sendAsync($request, $this->createHttpClientOption())
@@ -1465,7 +1465,7 @@ function ($exception) {
14651465
* @throws \InvalidArgumentException
14661466
* @return \GuzzleHttp\Psr7\Request
14671467
*/
1468-
protected function postExportRequest($file, $object_type, $format)
1468+
protected function postExportRequest($file, $object_type, $format, $extended_query_parameters = null)
14691469
{
14701470
// verify the required parameter 'file' is set
14711471
if ($file === null) {
@@ -1501,7 +1501,11 @@ protected function postExportRequest($file, $object_type, $format)
15011501
if ($format !== null) {
15021502
$queryParams['format'] = ObjectSerializer::toQueryValue($format);
15031503
}
1504-
1504+
if($extended_query_parameters !== null){
1505+
foreach($extended_query_parameters as $key => $value) {
1506+
$queryParams[$key] = ObjectSerializer::toQueryValue($value);
1507+
}
1508+
}
15051509

15061510
// form params
15071511
if ($file !== null) {

lib/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Configuration
8787
*
8888
* @var string
8989
*/
90-
protected $userAgent = 'Swagger-Codegen/22.3/php';
90+
protected $userAgent = 'Swagger-Codegen/22.4/php';
9191

9292
/**
9393
* Debug switch (default set to false)
@@ -395,8 +395,8 @@ public static function toDebugReport()
395395
$report = 'PHP SDK (Aspose\Cells\Cloud) Debug Report:' . PHP_EOL;
396396
$report .= ' OS: ' . php_uname() . PHP_EOL;
397397
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
398-
$report .= ' OpenAPI Spec Version: 22.3' . PHP_EOL;
399-
$report .= ' SDK Package Version: 22.3' . PHP_EOL;
398+
$report .= ' OpenAPI Spec Version: 22.4' . PHP_EOL;
399+
$report .= ' SDK Package Version: 22.4' . PHP_EOL;
400400
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
401401

402402
return $report;

test/Api/CellsExportApiTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,20 @@ public function testCellsExportShapeToPNGPostRun()
142142
// print( $result);
143143
$this->assertNotNull($result);
144144
}
145+
146+
public function testCellsExportWorkbookToPdfExtandPostRun()
147+
{
148+
$book1 = "Book1.xlsx";
149+
$mydoc = "myDocument.xlsx";
150+
$files = array (
151+
$mydoc => CellsApiTestBase::getfullfilename($mydoc),
152+
$book1 => CellsApiTestBase::getfullfilename($book1)
153+
);
154+
$extended_parameters = array (
155+
"OnePagePerSheet" => "false"
156+
);
157+
$result = $this->instance->postExport($files , 'workbook','pdf',$extended_parameters );
158+
// print( $result);
159+
$this->assertNotNull($result);
160+
}
145161
}

test/Api/CellsSaveAsApiTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,20 @@ public function testCellsSaveAsPostDocumentSaveAsPDFDropBoxTest()
177177
$result = $this->instance->cellsSaveAsPostDocumentSaveAs($name, $saveOptions, $newfilename,$isAutoFitRows, $isAutoFitColumns, $folder, $storage);
178178
$this->assertEquals(200, $result['code']);
179179
}
180+
public function testCellsSaveAsPostDocumentSaveAsPDFExtendTest()
181+
{
182+
$name ='Book1.xlsx';
183+
$saveOptions = new MarkdownSaveOptions();
184+
$saveOptions->SaveFormat = "markdown";
185+
$newfilename = "newbook.pdf.md";
186+
$isAutoFitRows= 'true';
187+
$isAutoFitColumns= 'true';
188+
$folder = "Temp";
189+
CellsApiTestBase::ready( $this->instance,$name ,$folder);
190+
$extended_parameters = array (
191+
"OnePagePerSheet" => "false"
192+
);
193+
$result = $this->instance->cellsSaveAsPostDocumentSaveAs($name, $saveOptions, $newfilename,$isAutoFitRows, $isAutoFitColumns, $folder,null,null,$extended_parameters);
194+
$this->assertEquals(200, $result['code']);
195+
}
180196
}

test/Api/CellsWorkbookApiTest.php

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,19 @@ public function testCellsWorkbookGetWorkbook()
149149
// echo($json );
150150
$this->assertEquals(200, $json->Code);
151151
}
152-
152+
public function testCellsWorkbookGetWorkbookExtend()
153+
{
154+
$name ='Book1.xlsx';
155+
$folder = "Temp";
156+
$password = null;
157+
$isAutoFit = 'true';
158+
CellsApiTestBase::ready( $this->instance,$name ,$folder);
159+
$extended_parameters = array (
160+
"OnePagePerSheet" => "false"
161+
);
162+
$result = $this->instance->cellsWorkbookGetWorkBook($name,$password,'pdf',$isAutoFit, 'false',$folder,null,null,null,$extended_parameters);
163+
$this->assertGreaterThan(120000, $result->getSize());
164+
}
153165
/**
154166
* Test case for cellsWorkbookGetWorkBook format
155167
*
@@ -602,6 +614,29 @@ public function testCellsWorkbookPutConvertWorkBook()
602614
$result = $this->instance->cellsWorkbookPutConvertWorkBook($path ,$format, $password, $outPath);
603615
// $this->assertEquals(119592, $result->getSize());
604616
}
617+
public function testCellsWorkbookPutConvertExtendWorkBook()
618+
{
619+
$format ='pdf';
620+
$password = null;
621+
$outPath = null;
622+
$cwd = getcwd();
623+
$parents = "/";
624+
$name = "TestData/Book1.xlsx";
625+
$file = null;
626+
for ($x=0; $x <= 10; $x++) {
627+
$path = $cwd . $parents . $name;
628+
if (file_exists($path)) {
629+
$file = file_get_contents($path);
630+
break;
631+
}
632+
$parents = $parents . "../";
633+
}
634+
$extended_parameters = array (
635+
"OnePagePerSheet" => "false"
636+
);
637+
$result = $this->instance->cellsWorkbookPutConvertWorkBook($path ,$format, $password, $outPath,null,$extended_parameters);
638+
// $this->assertEquals(119592, $result->getSize());
639+
}
605640
public function testCellsWorkbookPutConvertWorkBookToOtherStorage()
606641
{
607642
$format ='pdf';

0 commit comments

Comments
 (0)