Skip to content

Commit 5306cd6

Browse files
committed
Release Aspose.Cells Cloud SDK 20.11
1 parent b7bac45 commit 5306cd6

File tree

9 files changed

+62
-32
lines changed

9 files changed

+62
-32
lines changed

README.md

Lines changed: 3 additions & 4 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/20.10)
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/20.11)
22

33
# Java SDK for Spreadsheet Processing in the Cloud
44

@@ -24,10 +24,9 @@ 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-
## Enhancements in Version 20.10
27+
## Enhancements in Version 20.11
2828

29-
- Support to upload large file.
30-
- Enhancement for post sparkline group API.
29+
- Support Aspose.Cells Cloud for Docker.
3130

3231
## Read & Write Spreadsheet Formats
3332

docs/CellsApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13598,8 +13598,8 @@ Get Access token
1359813598

1359913599
CellsApi apiInstance = new CellsApi();
1360013600
String grantType = "grantType_example"; // String | Grant Type
13601-
String clientId = "clientId_example"; // String | App SID
13602-
String clientSecret = "clientSecret_example"; // String | App Key
13601+
String clientId = "clientId_example"; // String | client Id
13602+
String clientSecret = "clientSecret_example"; // String | client Secret
1360313603
try {
1360413604
AccessTokenResponse result = apiInstance.oAuthPost(grantType, clientId, clientSecret);
1360513605
System.out.println(result);
@@ -13614,8 +13614,8 @@ try {
1361413614
Name | Type | Description | Notes
1361513615
------------- | ------------- | ------------- | -------------
1361613616
**grantType** | **String**| Grant Type |
13617-
**clientId** | **String**| App SID |
13618-
**clientSecret** | **String**| App Key |
13617+
**clientId** | **String**| client Id |
13618+
**clientSecret** | **String**|client Secret |
1361913619

1362013620
### Return type
1362113621

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>20.10</version>
8+
<version>20.11</version>
99
<url>https://github.com/aspose-cells-cloud/aspose-cells-cloud-java</url>
1010
<scm>
1111
<connection>scm:git:[email protected]:aspose-cells-cloud/aspose-cells-cloud-java</connection>

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,39 +167,42 @@ public CellsApi(ApiClient apiClient) {
167167
this.apiClient = apiClient;
168168
}
169169

170-
public CellsApi(String appSid, String appKey) throws ApiException {
170+
public CellsApi(String clientId, String clientSecret) throws ApiException {
171171
ApiClient apiClient = new ApiClient();
172172
apiClient.setBasePath("https://api.aspose.cloud");
173173
apiClient.setApiVersion("v3.0");
174174
String accesstoken = apiClient.getAccessToken("client_credentials",
175-
appSid, appKey, "v3.0");
175+
clientId, clientSecret, "v3.0");
176176
apiClient.addDefaultHeader("Authorization", "Bearer " + accesstoken);
177177
setApiClient(apiClient);
178178
}
179179

180-
public CellsApi(String appSid, String appKey, String Version)
180+
public CellsApi(String clientId, String clientSecret, String Version)
181181
throws ApiException {
182182

183183
ApiClient apiClient = new ApiClient();
184184
apiClient.setBasePath("https://api.aspose.cloud");
185185
apiClient.setApiVersion(Version);
186186
String accesstoken = apiClient.getAccessToken("client_credentials",
187-
appSid, appKey, Version);
187+
clientId, clientSecret, Version);
188188

189189
apiClient.addDefaultHeader("Authorization", "Bearer " + accesstoken);
190190
setApiClient(apiClient);
191191
}
192192

193-
public CellsApi(String appSid, String appKey, String Version, String baseURI)
193+
public CellsApi(String clientId, String clientSecret, String Version, String baseURI)
194194
throws ApiException {
195195

196196
ApiClient apiClient = new ApiClient();
197197
apiClient.setBasePath(baseURI.endsWith("/") ? baseURI.substring(0,
198198
baseURI.length() - 1) : baseURI);
199199
apiClient.setApiVersion(Version);
200-
String accesstoken = apiClient.getAccessToken("client_credentials",
201-
appSid, appKey, Version);
202-
apiClient.addDefaultHeader("Authorization", "Bearer " + accesstoken);
200+
if((clientId == null || clientId.length() == 0) && (clientSecret == null ||clientSecret.length() == 0)){
201+
apiClient.SetNeedAuth(false);
202+
}else{
203+
String accesstoken = apiClient.getAccessToken("client_credentials", clientId, clientSecret, "v3.0");
204+
apiClient.addDefaultHeader("Authorization", "Bearer " + accesstoken);
205+
}
203206
setApiClient(apiClient);
204207
}
205208

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ public class ApiClient {
149149

150150
private HttpLoggingInterceptor loggingInterceptor;
151151

152+
private boolean needAuth = true;
153+
154+
/*
155+
* Set needAuth
156+
*/
157+
public void SetNeedAuth(boolean need)
158+
{
159+
needAuth = need;
160+
}
152161
/*
153162
* Constructor for ApiClient
154163
*/
@@ -179,15 +188,15 @@ public ApiClient() {
179188
// Setup authentications (key: authentication name, value:
180189
// authentication).
181190
authentications = new HashMap<String, Authentication>();
182-
authentications.put("appsid", new ApiKeyAuth("query", "appsid"));
191+
authentications.put("clientId", new ApiKeyAuth("query", "clientId"));
183192
authentications.put("oauth", new OAuth());
184193
authentications.put("signature", new ApiKeyAuth("query", "signature"));
185194
// Prevent the authentications from being modified.
186195
authentications = Collections.unmodifiableMap(authentications);
187196
}
188197

189-
private String appSid;
190-
private String appKey;
198+
private String _clientId;
199+
private String _clientSecret;
191200
private String appVersion = "v3.0";
192201
private String appGrantType;
193202
private DateTime getAccessTokenTime;
@@ -208,8 +217,8 @@ public String getAccessToken(String grantType, String clientId,
208217

209218
// create path and map variables]
210219
appGrantType = grantType;
211-
appSid = clientId;
212-
appKey = clientSecret;
220+
_clientId = clientId;
221+
_clientSecret = clientSecret;
213222
appVersion = version;
214223

215224
String localVarPath = "/connect/token";
@@ -257,8 +266,11 @@ public void checkAccessToken() throws ApiException {
257266
if (getAccessTokenTime == null) {
258267
return;
259268
}
269+
if((_clientId == null || _clientId.length() == 0) && (_clientSecret == null ||_clientSecret.length() == 0)){
270+
return;
271+
}
260272
if (DateTime.now().compareTo(getAccessTokenTime.plusSeconds(86300))>0 ) {
261-
String accessToken = getAccessToken(appGrantType, appSid, appKey,
273+
String accessToken = getAccessToken(appGrantType, _clientId, _clientSecret,
262274
appVersion);
263275
getAccessTokenTime = DateTime.now();
264276
addDefaultHeader("Authorization", "Bearer " + accessToken);
@@ -1325,8 +1337,9 @@ public Request buildRequest(String path, String method,
13251337
String[] authNames,
13261338
ProgressRequestBody.ProgressRequestListener progressRequestListener)
13271339
throws ApiException {
1328-
updateParamsForAuth(authNames, queryParams, headerParams);
1329-
1340+
if(needAuth) {
1341+
updateParamsForAuth(authNames, queryParams, headerParams);
1342+
}
13301343
final String url = buildUrl(path, queryParams);
13311344
final Request.Builder reqBuilder = new Request.Builder().url(url);
13321345
processHeaderParams(headerParams, reqBuilder);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public CellsApiForV11Test(){
9595
@Ignore("Not Ready to Run")
9696
@Test
9797
public void cellsDeleteWorksheetColumnsTest() throws Exception {
98+
if(CellsApiUtil.IsDockerTest()){
99+
return;
100+
}
98101
String name = BOOK1;
99102
String sheetName = SHEET1;
100103
Integer columnIndex = 1;
@@ -115,6 +118,9 @@ public void cellsDeleteWorksheetColumnsTest() throws Exception {
115118
@Ignore("Not Ready to Run")
116119
@Test
117120
public void cellsDeleteWorksheetRowTest() throws ApiException {
121+
if(CellsApiUtil.IsDockerTest()){
122+
return;
123+
}
118124
String name = BOOK1;
119125
String sheetName = SHEET1;
120126
Integer rowIndex = 1;

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
public class CellsApiUtil {
1414
private static String grantType = "client_credentials";
15-
private static String clientId = "91A2FD07-BBA1-4B32-9112-ABFB1FE8AEBD";//"";
16-
private static String clientSecret = "0fbf678c5ecabdb5caca48452a736dd0";//"";
15+
private static String clientId = "";//"";
16+
private static String clientSecret = "";//"";
1717
private static String sourceFolder ="/TestData/";
1818
public static String GetSourceFolder() {
1919
return System.getProperty("user.dir") + sourceFolder;
@@ -23,18 +23,21 @@ public static String GetGrantType() {
2323
}
2424

2525
public static String GetClientId() {
26-
return "91A2FD07-BBA1-4B32-9112-ABFB1FE8AEBD";
26+
return System.getenv("CellsCloudTestClientId");
2727
}
2828

2929
public static String GetClientSecret() {
30-
return "0fbf678c5ecabdb5caca48452a736dd0";
30+
return System.getenv("CellsCloudTestClientSecret");
3131
}
3232

3333
public static String GetAPIVersion() {
3434
return "v3.0";
3535
}
3636
public static String GetBaseUrl() {
37-
return "https://api-qa.aspose.cloud";
37+
return System.getenv("CellsCloudTestApiBaseUrl");
38+
}
39+
public static Boolean IsDockerTest(){
40+
return Boolean.getBoolean( System.getenv("CellsCloudTestIsDockerTest"));
3841
}
3942
public static void Upload(CellsApi cellsApi,String folder ,String filename) {
4043
File file = new File(System.getProperty("user.dir") + sourceFolder + filename);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public CellsAutoshapesApiTest(){
7373
*/
7474
@Test
7575
public void cellsAutoshapesGetWorksheetAutoshapeTest() throws ApiException {
76+
if(CellsApiUtil.IsDockerTest()){
77+
return;
78+
}
7679
String name = MYDOC;
7780
String sheetName = SHEET2;
7881
Integer autoshapeNumber = 4;
@@ -94,6 +97,9 @@ public void cellsAutoshapesGetWorksheetAutoshapeTest() throws ApiException {
9497
*/
9598
@Test
9699
public void cellsAutoshapesGetWorksheetAutoshapesTest() throws ApiException {
100+
if(CellsApiUtil.IsDockerTest()){
101+
return;
102+
}
97103
String name = MYDOC;
98104
String sheetName = SHEET2;
99105
String folder = TEMPFOLDER;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ public void cellsListObjectsPostWorksheetListObjectSummarizeWithPivotTableTest()
249249
pivotFieldColumns.add(2);
250250
request.setPivotFieldColumns(pivotFieldColumns);
251251
List<Integer> pivotFieldRows = new ArrayList<Integer>();
252-
pivotFieldColumns.add(2);
252+
pivotFieldRows.add(1);
253253
request.setPivotFieldRows(pivotFieldRows);
254254
List<Integer> pivotFieldData = new ArrayList<Integer>();
255-
pivotFieldColumns.add(2);
255+
pivotFieldData.add(0);
256256
request.setPivotFieldData(pivotFieldData);
257257
request.setSourceData("=Sheet2!A1:E8");
258258
request.setUseSameSource(true);

0 commit comments

Comments
 (0)