Skip to content

Commit 6749924

Browse files
###### Date: 26-July-2019
- [Entry] - Added support for includeReferenceContentTypeUid support in Entry. - [Query] - Added support for includeReferenceContentTypeUid support in Query. - [Entry] - setLanguage and getLanguage Deprecated in Entry. - [Query] - language deprecated in Query - [Entry] - Added method for getLocale and setLocale(String locale) in Entry - [Query] - Added method for locale in Query. - [Query] - Removed deprecated method for includeSchema in Query
1 parent 1462ad9 commit 6749924

File tree

13 files changed

+114
-49
lines changed

13 files changed

+114
-49
lines changed

CHANGELOG.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11

22
## CHANGELOG
33

4+
5+
## Version 1.4.0
6+
###### Date: 26-July-2019
7+
- [Entry] - Added support for includeReferenceContentTypeUid support in Entry.
8+
- [Query] - Added support for includeReferenceContentTypeUid support in Query.
9+
- [Entry] - setLanguage and getLanguage Deprecated in Entry.
10+
- [Query] - language deprecated in Query
11+
- [Entry] - Added method for getLocale and setLocale(String locale) in Entry
12+
- [Query] - Added method for locale in Query.
13+
- [Query] - Removed deprecated method for includeSchema in Query
14+
15+
------------------------------------------------
16+
17+
18+
## Version 1.3.3
19+
###### Date: 21-June-2019
20+
- Override response hot-fix
21+
22+
------------------------------------------------
23+
424
## Version 1.3.2
525
### Date: 13-May-2019
6-
Removed println
7-
Added support for Logger
26+
- Removed println
27+
- Added support for Logger
828

929
------------------------------------------------
1030

1131
## Version 1.3.1
12-
### Date: May-02-2019
13-
Change: include reference bug fixed
14-
added testcase report for v1.3.1
32+
###### Date: May-02-2019
33+
- Change: include reference bug fixed
34+
- added testcase report for v1.3.1
1535

1636

1737
------------------------------------------------
1838

1939

2040
## Version 1.3.0
21-
### Date: Apr-12-2019
41+
###### Date: Apr-12-2019
2242
Change: Added support of below methods in SDK
2343

2444
```
@@ -33,7 +53,7 @@ Below two support from the Config class has been removed permanently
3353
------------------------------------------------
3454

3555
## Version 1.2.1
36-
### Date: 14-Mar-2019
56+
###### Date: 14-Mar-2019
3757
- Note: Bug Fixes and code clean up:
3858

3959
--------------------------------
@@ -44,7 +64,7 @@ Folder structure modified.
4464

4565
------------------------------------------------
4666
## Version 1.2.0
47-
### Date: 15-Dec-2017
67+
###### Date: 15-Dec-2017
4868
- New Features:
4969
```
5070
Entry- added method ‘addParam’
@@ -54,7 +74,7 @@ Asset- added method 'addParam'
5474
------------------------------------------------
5575

5676
## Version 1.1.0
57-
### Date: 10-Nov-2017
77+
###### Date: 10-Nov-2017
5878
- New Features:
5979
```
6080
Stack- added method 'ImageTransform'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ To use the Contentstack Java SDK to your existing project, perform the steps giv
2020
<dependency>
2121
<groupId>com.contentstack.sdk</groupId>
2222
<artifactId>java</artifactId>
23-
<version>1.3.2</version>
23+
<version>1.4.0</version>
2424
</dependency>
2525
```
2626

2727
2. **Gradle**
2828
```
29-
implementation 'com.contentstack.sdk:java:1.3.2'
29+
implementation 'com.contentstack.sdk:java:1.4.0'
3030
```
3131

3232
### Key Concepts for using Contentstack

pom.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Written manually.
2-
version=1.3.2
2+
version=1.3.3
33
groupId=com.contentstack.sdk
44
artifactId=java

src/main/java/com/contentstack/sdk/AssetLibrary.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import java.util.*;
99

1010
/**
11+
* @Author Shailesh Mishra
12+
*
1113
* MIT License
1214
*
1315
* Copyright (c) 2012 - 2019 Contentstack

src/main/java/com/contentstack/sdk/AssetModel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
/**
10+
* @Author Shailesh Mishra
11+
*
1012
* MIT License
1113
*
1214
* Copyright (c) 2012 - 2019 Contentstack

src/main/java/com/contentstack/sdk/CSBackgroundTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
package com.contentstack.sdk;import com.contentstack.sdk.utility.CSAppConstants;import org.json.JSONObject;import java.util.HashMap;import java.util.LinkedHashMap;/** * @Author Contentstack * * MIT License * * Copyright (c) 2012 - 2019 Contentstack * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */class CSBackgroundTask { public CSBackgroundTask(Query queryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, LinkedHashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(queryInstance); csConnectionRequest.setQueryInstance(queryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Entry entryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callBack) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(entryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callBack); } else { sendErrorForHeader(callBack); } } else { sendErrorToUser(callBack); } } public CSBackgroundTask(AssetLibrary assetLibrary, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(assetLibrary); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Asset asset, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(asset); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(stackInstance); csConnectionRequest.setStackInstance(stackInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(ContentType contentTypeInstance, Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(contentTypeInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } private void sendErrorToUser(ResultCallBack callbackObject){ Error error = new Error(); error.setErrorCode(CSAppConstants.NONETWORKCONNECTION); error.setErrorMessage(CSAppConstants.ErrorMessage_NoNetwork); if(callbackObject != null){ callbackObject.onRequestFail(ResponseType.UNKNOWN,error); } } private void sendErrorForHeader(ResultCallBack callbackObject) { Error error = new Error(); error.setErrorMessage(CSAppConstants.ErrorMessage_CalledDefaultMethod); if (callbackObject != null) { callbackObject.onRequestFail(ResponseType.UNKNOWN, error); } }}
1+
package com.contentstack.sdk;import com.contentstack.sdk.utility.CSAppConstants;import org.json.JSONObject;import java.util.HashMap;import java.util.LinkedHashMap;/** * @Author Contentstack * * MIT License * * Copyright (c) 2012 - 2019 Contentstack * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */class CSBackgroundTask { public CSBackgroundTask(Query queryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, LinkedHashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(queryInstance); csConnectionRequest.setQueryInstance(queryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Entry entryInstance, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callBack) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(entryInstance); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callBack); } else { sendErrorForHeader(callBack); } } else { sendErrorToUser(callBack); } } public CSBackgroundTask(AssetLibrary assetLibrary, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(assetLibrary); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Asset asset, Stack stackInstance, String controller, String url, LinkedHashMap<String, Object> headers, HashMap<String, Object> urlQueries, JSONObject jsonMain, String requestInfo, boolean isOffline, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(asset); csConnectionRequest.setURLQueries(urlQueries); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(stackInstance); csConnectionRequest.setStackInstance(stackInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } public CSBackgroundTask(ContentType contentTypeInstance, Stack stackInstance, String controller, String url, HashMap<String, Object> headers, HashMap<String, Object> urlParams, JSONObject jsonMain, String requestInfo, boolean b, CSAppConstants.RequestMethod method, ResultCallBack callback) { if (CSAppConstants.isNetworkAvailable()) { if (headers != null && headers.size() > 0) { String URL = stackInstance.URLSCHEMA + stackInstance.URL + url; CSConnectionRequest csConnectionRequest = new CSConnectionRequest(contentTypeInstance); csConnectionRequest.setURLQueries(urlParams); csConnectionRequest.setParams(URL, method, controller, jsonMain, headers, requestInfo, callback); } else { sendErrorForHeader(callback); } } else { sendErrorToUser(callback); } } private void sendErrorToUser(ResultCallBack callbackObject){ int NONETWORKCONNECTION = 408; Error error = new Error(); error.setErrorCode(NONETWORKCONNECTION); error.setErrorMessage(CSAppConstants.ErrorMessage_NoNetwork); if(callbackObject != null){ callbackObject.onRequestFail(ResponseType.UNKNOWN,error); } } private void sendErrorForHeader(ResultCallBack callbackObject) { Error error = new Error(); error.setErrorMessage(CSAppConstants.ErrorMessage_CalledDefaultMethod); if (callbackObject != null) { callbackObject.onRequestFail(ResponseType.UNKNOWN, error); } }}

src/main/java/com/contentstack/sdk/CSConnectionRequest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.*;
99

1010
/**
11-
* @Author Contentstack
11+
* @Author Shailesh Mishra
1212
*
1313
* MIT License
1414
*
@@ -223,6 +223,8 @@ else if(controller.equalsIgnoreCase(CSController.SINGLEQUERYOBJECT)){
223223
entryInstance.ownerUid = model.ownerUid;
224224
entryInstance.title = model.title;
225225
entryInstance.url = model.url;
226+
entryInstance.language = model.language;
227+
226228
if(model.ownerMap != null) {
227229
entryInstance.owner = new HashMap<>(model.ownerMap);
228230
}

0 commit comments

Comments
 (0)