Skip to content

Commit dcb3687

Browse files
Merge pull request #8 from contentstack/development
Development
2 parents b214388 + d46f2a1 commit dcb3687

20 files changed

+168
-204
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
## CHANGELOG
33

4+
------------------------------------------------
5+
6+
## Version 1.4.1
7+
###### Date: 21-August-2019
8+
- [Query] - Added support for whereIn(String key) and whereNotIn(String key) methods
9+
- [CSAppConstants] - Removed google internet connection check from CSAppConstants
10+
11+
------------------------------------------------
12+
13+
414
## Version 1.4.0
515
###### Date: 26-July-2019
616
- [Entry] - Added support for includeReferenceContentTypeUid support in Entry.

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.4.0</version>
23+
<version>1.4.1</version>
2424
</dependency>
2525
```
2626

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

3232
### Key Concepts for using Contentstack

pom.xml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.contentstack.sdk</groupId>
88
<artifactId>java</artifactId>
9-
<version>1.4.0</version>
9+
<version>1.4.2-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>contentstack-java</name>
@@ -43,7 +43,7 @@
4343
<url>https://github.com/contentstack/contentstack-java/tree/master</url>
4444
<connection>scm:git:git://github.com/contentstack/contentstack-java.git</connection>
4545
<developerConnection>scm:git:ssh://github.com:contentstack/contentstack-java.git</developerConnection>
46-
<tag>v1.2.1</tag>
46+
<tag>v1.4.0</tag>
4747
</scm>
4848

4949
<issueManagement>
@@ -121,20 +121,42 @@
121121
<plugin>
122122
<groupId>org.apache.maven.plugins</groupId>
123123
<artifactId>maven-javadoc-plugin</artifactId>
124-
<version>2.9.1</version>
125-
<configuration>
126-
<additionalparam>-Xdoclint:none</additionalparam>
127-
</configuration>
124+
<version>3.1.1</version>
128125
<executions>
129126
<execution>
130127
<id>attach-javadocs</id>
131128
<goals>
132129
<goal>jar</goal>
133130
</goals>
131+
<configuration>
132+
<use>false</use>
133+
<use>false</use>
134+
<source>1.8</source>
135+
<links><link>http://docs.oracle.com/javase/7/docs/api/</link> <link>http://docs.oracle.com/javase/7/docs/api/</link></links>
136+
<doclint>none</doclint>
137+
</configuration>
134138
</execution>
135139
</executions>
136140
</plugin>
137141

142+
<plugin>
143+
<groupId>org.apache.maven.plugins</groupId>
144+
<artifactId>maven-site-plugin</artifactId>
145+
<version>3.3</version>
146+
<configuration>
147+
<reportPlugins>
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-javadoc-plugin</artifactId>
151+
<configuration>
152+
<!--suppress UnresolvedMavenProperty -->
153+
<additionalparam>${javadoc.opts}</additionalparam>
154+
</configuration>
155+
</plugin>
156+
</reportPlugins>
157+
</configuration>
158+
</plugin>
159+
138160
<plugin>
139161
<groupId>org.apache.maven.plugins</groupId>
140162
<artifactId>maven-gpg-plugin</artifactId>

profiles.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
5+
<profiles>
6+
<profile>
7+
<id>77b9c8fd28426a</id>
8+
<!--<id>B16B07F68332BB77</id>-->
9+
<activation>
10+
<property>
11+
<name>performRelease</name>
12+
<value>true</value>
13+
</property>
14+
</activation>
15+
</profile>
16+
17+
<profile>
18+
<id>java8-doclint-disabled</id>
19+
<activation>
20+
<jdk>[1.8,)</jdk>
21+
</activation>
22+
<properties>
23+
<javadoc.opts>-Xdoclint:none</javadoc.opts>
24+
</properties>
25+
</profile>
26+
27+
</profiles>
28+
</profilesXml>

src/log4j.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This sets the global logging level and specifies the appenders
22
log4j.rootLogger=DEBUG, theConsoleAppender
3-
43
# settings for the console appender
54
log4j.appender.theConsoleAppender=org.apache.log4j.ConsoleAppender
65
log4j.appender.theConsoleAppender.layout=org.apache.log4j.PatternLayout

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

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

1010
/**
11-
* @Author Shailesh Mishra
1211
*
1312
* MIT License
1413
*

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){ 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); } }}
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 (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); } } 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 (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); } } 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 (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); } } 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 (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); } } 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 (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); } } 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 (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); } } 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/Config.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ public class Config {
3131
protected String VERSION = "v3";
3232
protected String environment = null;
3333

34+
35+
3436
/**
35-
* BuiltConfig constructor
37+
* Config constructor
3638
*
3739
* <br><br><b>Example :</b><br>
3840
* <pre class="prettyprint">
39-
* BuiltConfig config = new BuiltConfig();
41+
* Config config = new Config();
4042
* </pre>
4143
*/
4244

@@ -93,8 +95,7 @@ public String getVersion(){
9395
/**
9496
* Changes the Contentstack version to be used in the final URL.
9597
*
96-
* @param version
97-
* version string.
98+
* @param version version string.
9899
*
99100
* <br><br><b>Example :</b><br>
100101
* <pre class="prettyprint">

0 commit comments

Comments
 (0)