Skip to content

Commit 901db54

Browse files
committed
20220418 update : update four api.
1 parent 56754f5 commit 901db54

File tree

8 files changed

+137
-58
lines changed

8 files changed

+137
-58
lines changed

README.md

Lines changed: 6 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) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-java/22.3)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-java/22.4)
22

33
# Java SDK for Spreadsheet Processing in the Cloud
44

@@ -24,9 +24,12 @@ This Cloud SDK enhances your Java-based cloud apps to [process & manipulate Micr
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
2828

29-
- Add new API about adding digital signature for cloud file.
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.
3033

3134

3235
## Read & Write Spreadsheet Formats

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aspose-cells-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>aspose-cells-cloud</name>
8-
<version>22.3</version>
8+
<version>22.4</version>
99
<url>https://github.com/aspose-cells-cloud/aspose-cells-cloud-java</url>
1010
<scm>
1111
<connection>scm:git:git@github.com:aspose-cells-cloud/aspose-cells-cloud-java</connection>

src/main/java/com/aspose/cloud/cells/api/CellsApi.java

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

src/main/java/com/aspose/cloud/cells/api/LightCellsApi.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
640640
* @return Call to execute
641641
* @throws ApiException If fail to serialize the request body object
642642
*/
643-
public com.squareup.okhttp.Call postExportCall(HashMap<String,File> file, String objectType, String format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
643+
public com.squareup.okhttp.Call postExportCall(HashMap<String,File> file, String objectType, String format,HashMap<String,String> extendedQueryParameters, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
644644
Object localVarPostBody = null;
645645

646646
// create path and map variables
@@ -652,6 +652,12 @@ public com.squareup.okhttp.Call postExportCall(HashMap<String,File> file, String
652652
if (format != null)
653653
localVarQueryParams.addAll(apiClient.parameterToPairs("", "format", format));
654654

655+
if(extendedQueryParameters!=null){
656+
for (String key : extendedQueryParameters.keySet()) {
657+
localVarQueryParams.addAll(apiClient.parameterToPairs("", key, extendedQueryParameters.get(key)));
658+
}
659+
}
660+
655661
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
656662

657663
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
@@ -691,7 +697,7 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch
691697
}
692698

693699
@SuppressWarnings("rawtypes")
694-
private com.squareup.okhttp.Call postExportValidateBeforeCall(HashMap<String,File> file, String objectType, String format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
700+
private com.squareup.okhttp.Call postExportValidateBeforeCall(HashMap<String,File> file, String objectType, String format, HashMap<String,String> extendedQueryParameters, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
695701

696702
// verify the required parameter 'file' is set
697703
if (file == null) {
@@ -709,7 +715,7 @@ private com.squareup.okhttp.Call postExportValidateBeforeCall(HashMap<String,Fil
709715
}
710716

711717

712-
com.squareup.okhttp.Call call = postExportCall(file, objectType, format, progressListener, progressRequestListener);
718+
com.squareup.okhttp.Call call = postExportCall(file, objectType, format, extendedQueryParameters, progressListener, progressRequestListener);
713719
return call;
714720

715721

@@ -727,8 +733,8 @@ private com.squareup.okhttp.Call postExportValidateBeforeCall(HashMap<String,Fil
727733
* @return FilesResult
728734
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
729735
*/
730-
public FilesResult postExport(HashMap<String,File> file, String objectType, String format) throws ApiException {
731-
ApiResponse<FilesResult> resp = postExportWithHttpInfo(file, objectType, format);
736+
public FilesResult postExport(HashMap<String,File> file, String objectType, String format, HashMap<String,String> extendedQueryParameters) throws ApiException {
737+
ApiResponse<FilesResult> resp = postExportWithHttpInfo(file, objectType, format,extendedQueryParameters);
732738
return resp.getData();
733739
}
734740

@@ -741,8 +747,8 @@ public FilesResult postExport(HashMap<String,File> file, String objectType, Stri
741747
* @return ApiResponse&lt;FilesResult&gt;
742748
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
743749
*/
744-
public ApiResponse<FilesResult> postExportWithHttpInfo(HashMap<String,File> file, String objectType, String format) throws ApiException {
745-
com.squareup.okhttp.Call call = postExportValidateBeforeCall(file, objectType, format, null, null);
750+
public ApiResponse<FilesResult> postExportWithHttpInfo(HashMap<String,File> file, String objectType, String format, HashMap<String,String> extendedQueryParameters ) throws ApiException {
751+
com.squareup.okhttp.Call call = postExportValidateBeforeCall(file, objectType, format, extendedQueryParameters, null, null);
746752
Type localVarReturnType = new TypeToken<FilesResult>(){}.getType();
747753
return apiClient.execute(call, localVarReturnType);
748754
}
@@ -757,7 +763,7 @@ public ApiResponse<FilesResult> postExportWithHttpInfo(HashMap<String,File> file
757763
* @return The request call
758764
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
759765
*/
760-
public com.squareup.okhttp.Call postExportAsync(HashMap<String,File> file, String objectType, String format, final ApiCallback<FilesResult> callback) throws ApiException {
766+
public com.squareup.okhttp.Call postExportAsync(HashMap<String,File> file, String objectType, String format,HashMap<String,String> extendedQueryParameters, final ApiCallback<FilesResult> callback) throws ApiException {
761767

762768
ProgressResponseBody.ProgressListener progressListener = null;
763769
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
@@ -778,7 +784,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
778784
};
779785
}
780786

781-
com.squareup.okhttp.Call call = postExportValidateBeforeCall(file, objectType, format, progressListener, progressRequestListener);
787+
com.squareup.okhttp.Call call = postExportValidateBeforeCall(file, objectType, format, extendedQueryParameters, progressListener, progressRequestListener);
782788
Type localVarReturnType = new TypeToken<FilesResult>(){}.getType();
783789
apiClient.executeAsync(call, localVarReturnType, callback);
784790
return call;

src/main/java/com/aspose/cloud/cells/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public ApiClient() {
183183
this.lenientDatetimeFormat = true;
184184

185185
// Set default User-Agent.
186-
setUserAgent("Swagger-Codegen/21.7/java");
186+
setUserAgent("Swagger-Codegen/22.4/java");
187187

188188
// Setup authentications (key: authentication name, value:
189189
// authentication).

src/test/java/com/aspose/cloud/cells/api/CellsExportApiTest.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void cellsPostExportApiTest_chart() throws ApiException {
6666
HashMap<String,File> fileMap = new HashMap<String,File>();
6767
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
6868
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
69-
FilesResult response = api.postExport(fileMap, "chart","png");
69+
FilesResult response = api.postExport(fileMap, "chart","png",null);
7070

7171
}
7272

@@ -77,15 +77,15 @@ public void cellsPostExportApiTest_shape() throws ApiException {
7777
HashMap<String,File> fileMap = new HashMap<String,File>();
7878
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
7979
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
80-
FilesResult response = api.postExport(fileMap, "shape","png");
80+
FilesResult response = api.postExport(fileMap, "shape","png",null);
8181
}
8282
@Test
8383
public void cellsPostExportApiTest_picture() throws ApiException {
8484

8585
HashMap<String,File> fileMap = new HashMap<String,File>();
8686
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
8787
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
88-
FilesResult response = api.postExport(fileMap, "picture","png");
88+
FilesResult response = api.postExport(fileMap, "picture","png",null);
8989
}
9090

9191
@Test
@@ -94,7 +94,7 @@ public void cellsPostExportApiTest_listobject() throws ApiException {
9494
HashMap<String,File> fileMap = new HashMap<String,File>();
9595
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
9696
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
97-
FilesResult response = api.postExport(fileMap, "listobject","png");
97+
FilesResult response = api.postExport(fileMap, "listobject","png",null);
9898
}
9999

100100
@Test
@@ -103,7 +103,7 @@ public void cellsPostExportApiTest_oleobject() throws ApiException {
103103
HashMap<String,File> fileMap = new HashMap<String,File>();
104104
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
105105
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
106-
FilesResult response = api.postExport(fileMap, "oleobject","png");
106+
FilesResult response = api.postExport(fileMap, "oleobject","png",null);
107107
}
108108

109109
@Test
@@ -112,7 +112,7 @@ public void cellsPostExportApiTest_worksheet() throws ApiException {
112112
HashMap<String,File> fileMap = new HashMap<String,File>();
113113
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
114114
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
115-
FilesResult response = api.postExport(fileMap, "sheet","png");
115+
FilesResult response = api.postExport(fileMap, "sheet","png",null);
116116
}
117117

118118
@Test
@@ -121,7 +121,16 @@ public void cellsPostExportApiTest_workbook() throws ApiException {
121121
HashMap<String,File> fileMap = new HashMap<String,File>();
122122
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
123123
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
124-
FilesResult response = api.postExport(fileMap, "workbook","png");
124+
FilesResult response = api.postExport(fileMap, "workbook","png",null);
125125
}
126+
@Test
127+
public void cellsPostExportApiTest_workbook_extend() throws ApiException {
126128

129+
HashMap<String,File> fileMap = new HashMap<String,File>();
130+
fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) );
131+
fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) );
132+
HashMap<String,String> extendParametersMap = new HashMap<String,String>();
133+
extendParametersMap.put("OnePagePerSheet","false");
134+
FilesResult response = api.postExport(fileMap, "workbook","pdf",extendParametersMap);
135+
}
127136
}

src/test/java/com/aspose/cloud/cells/api/CellsSaveAsApiTest.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void cellsSaveAsPostDocumentSaveAsTest() throws ApiException {
8080
String folder = TEMPFOLDER;
8181
CellsApiUtil.Upload(api, folder , name);
8282
SaveResponse response = api.cellsSaveAsPostDocumentSaveAs(name, saveOptions,
83-
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,null);
83+
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,null,null);
8484

8585
// TODO: test validations
8686
}
@@ -102,7 +102,7 @@ public void cellsSaveAsPostDocumentSaveAsMDTest() throws ApiException {
102102
String folder = TEMPFOLDER;
103103
CellsApiUtil.Upload(api, folder , name);
104104
SaveResponse response = api.cellsSaveAsPostDocumentSaveAs(name, saveOptions,
105-
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,null);
105+
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,null,null);
106106

107107
// TODO: test validations
108108
}
@@ -124,7 +124,24 @@ public void cellsSaveAsPostDocumentSaveAsOtherStorageTest() throws ApiException
124124
String folder = TEMPFOLDER;
125125
CellsApiUtil.Upload(api, folder , name);
126126
SaveResponse response = api.cellsSaveAsPostDocumentSaveAs(name, saveOptions,
127-
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,"DropBox");
127+
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,"DropBox",null);
128+
129+
// TODO: test validations
130+
}
131+
132+
@Test
133+
public void cellsSaveAsPostDocumentSaveAsExtendTest() throws ApiException {
134+
String name = BOOK1;
135+
SaveOptions saveOptions = null;
136+
String newfilename = "newbook.xlsx.md";
137+
Boolean isAutoFitRows = true;
138+
Boolean isAutoFitColumns = false;
139+
String folder = TEMPFOLDER;
140+
CellsApiUtil.Upload(api, folder , name);
141+
HashMap<String,String> extendParametersMap = new HashMap<String,String>();
142+
extendParametersMap.put("OnePagePerSheet","false");
143+
SaveResponse response = api.cellsSaveAsPostDocumentSaveAs(name, saveOptions,
144+
folder + "/"+ newfilename, isAutoFitRows, isAutoFitColumns, folder,null,null,extendParametersMap);
128145

129146
// TODO: test validations
130147
}

src/test/java/com/aspose/cloud/cells/api/CellsWorkbookApiTest.java

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void cellsWorkbookGetWorkbookTest() throws ApiException {
200200
String folder = TEMPFOLDER;
201201
CellsApiUtil.Upload(api, folder, name);
202202
File response = api.cellsWorkbookGetWorkbook(name, password, format,
203-
isAutoFit, onlySaveTable, folder, null, null,null);
203+
isAutoFit, onlySaveTable, folder, null, null,null,null);
204204

205205
// TODO: test validations
206206
}
@@ -223,7 +223,7 @@ public void cellsWorkbookGetWorkbookForMDTest() throws ApiException {
223223
String folder = TEMPFOLDER;
224224
CellsApiUtil.Upload(api, folder, name);
225225
File response = api.cellsWorkbookGetWorkbook(name, password, format,
226-
isAutoFit, onlySaveTable, folder, null, null,null);
226+
isAutoFit, onlySaveTable, folder, null, null,null,null);
227227

228228
// TODO: test validations
229229
}
@@ -237,7 +237,7 @@ public void cellsWorkbookGetWorkbookForMDTootherStorageTest() throws ApiExceptio
237237
String folder = TEMPFOLDER;
238238
CellsApiUtil.Upload(api, folder, name);
239239
File response = api.cellsWorkbookGetWorkbook(name, password, format,
240-
isAutoFit, onlySaveTable, folder, null, null,"DropBox");
240+
isAutoFit, onlySaveTable, folder, null, null,"DropBox",null);
241241

242242
// TODO: test validations
243243
}
@@ -678,7 +678,7 @@ public void cellsWorkbookPutConvertWorkbookTest() throws ApiException {
678678
String folder = TEMPFOLDER;
679679
CellsApiUtil.Upload(api, folder, name);
680680
File response = api.cellsWorkbookPutConvertWorkbook(
681-
CellsApiUtil.GetFileHolder(name), format, password, outPath ,null);
681+
CellsApiUtil.GetFileHolder(name), format, password, outPath ,null,null);
682682

683683
// TODO: test validations
684684
}
@@ -757,4 +757,36 @@ public void cellsWorkbookPostDigitalSignatureTest() throws ApiException {
757757
CellsApiUtil.Upload(api, null,"roywang.pfx");
758758
CellsCloudResponse response = api.cellsWorkbookPostDigitalSignature(name, "roywang.pfx", "123456",folder, null);
759759
}
760+
761+
@Test
762+
public void cellsWorkbookPutConvertWorkbookExtendTest() throws ApiException {
763+
String format = "pdf";
764+
String password = null;
765+
String outPath = null;
766+
String name = BOOK1;
767+
String folder = TEMPFOLDER;
768+
CellsApiUtil.Upload(api, folder, name);
769+
HashMap<String,String> extendParametersMap = new HashMap<String,String>();
770+
extendParametersMap.put("OnePagePerSheet","false");
771+
File response = api.cellsWorkbookPutConvertWorkbook(
772+
CellsApiUtil.GetFileHolder(name), format, password, outPath ,null,extendParametersMap);
773+
774+
// TODO: test validations
775+
}
776+
@Test
777+
public void cellsWorkbookGetWorkbookExtendTest() throws ApiException {
778+
String name = BOOK1;
779+
String password = null;
780+
Boolean isAutoFit = true;
781+
Boolean onlySaveTable = true;
782+
String format = "XPS";
783+
String folder = TEMPFOLDER;
784+
CellsApiUtil.Upload(api, folder, name);
785+
HashMap<String,String> extendParametersMap = new HashMap<String,String>();
786+
extendParametersMap.put("OnePagePerSheet","false");
787+
File response = api.cellsWorkbookGetWorkbook(name, password, format,
788+
isAutoFit, onlySaveTable, folder, null, null,null,extendParametersMap);
789+
790+
// TODO: test validations
791+
}
760792
}

0 commit comments

Comments
 (0)