Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a277071
fix: pom.xml to reduce vulnerabilities
snyk-bot Jun 16, 2022
2777b38
updated dependencies
ishaileshmishra Oct 10, 2022
b1ffeff
Merge branch 'master' into dev
ishaileshmishra Oct 10, 2022
5e8cabb
v1.10.2
ishaileshmishra Oct 20, 2022
1337f6d
Merge branch 'dev' of https://github.com/contentstack/contentstack-ja…
ishaileshmishra Oct 20, 2022
3087b34
Live Preview
ishaileshmishra Oct 31, 2022
7b35deb
Live Preview
ishaileshmishra Oct 31, 2022
8896b6c
Live Preview
ishaileshmishra Oct 31, 2022
eae094f
Live Preview
ishaileshmishra Oct 31, 2022
ac25c8e
Live Preview
ishaileshmishra Oct 31, 2022
9766476
:potted_plant: plugins support
ishaileshmishra Dec 8, 2022
324ad8c
:potted_plant: plugins support
ishaileshmishra Dec 8, 2022
7c6fd6a
Plugins implemented
ishaileshmishra Dec 9, 2022
3ed997c
:potted_plant: plugins support
ishaileshmishra Dec 9, 2022
71cbcf5
:potted_plant: CI/CD Pipeline
ishaileshmishra Dec 21, 2022
c27211b
:potted_plant: #67 error handling infinite loop issue
ishaileshmishra Feb 6, 2023
0f3a6ee
:potted_plant: #67 error handling infinite loop issue
ishaileshmishra Feb 6, 2023
a9074c1
Merge branch 'master' into plugins
ishaileshmishra Feb 7, 2023
4be4741
Merge branch 'master' into plugins
uttamukkoji Feb 7, 2023
0bdb775
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
3087a07
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
a72347d
Merge remote-tracking branch 'origin/plugins' into plugins
ishaileshmishra Feb 8, 2023
589d6e1
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
72e487f
:potted_plant: #67 resolved
ishaileshmishra Feb 8, 2023
2e31abf
:potted_plant: #67 pom.xml and CHANGELOG.md updated
ishaileshmishra Feb 8, 2023
4a27817
:potted_plant: LICENSE file updated
ishaileshmishra Feb 9, 2023
3c1d456
:potted_plant: LICENSE file updated
ishaileshmishra Feb 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish package to the Maven Central Repository
on:
release:
types: [ created ]
jobs:
publish-maven:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
server-id: shaileshmishra
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
- name: Publish package
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
publish-github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
server-id: github
- name: Publish to GitHub Packages
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Authors

- [ishaileshmishra]([email protected])
- [shaileshmishra]([email protected])
- [admin]([email protected])
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
# CHANGELOG

## v1.11.0

### Date: 09-FEB-2023

- Addition of Plugin Support,
- #67 error handling infinite loop issue
- Breaking change: Enums PublishType changed from snake-case to ALL_CAPS
- Basic Improvements

## v1.10.2

### Date: 22-Oct-2022

- LivePreview internal function implementation updated
- Jsoup dependency updated
- Json version updated

## v1.10.1

### Date: 18-June-2022

- Compile Issue With Gradle

### Date: 17-Jun-2022

- #57 CompileJava issue in Gradle build ecosystem (contentstack-utils)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012 - 2022 Contentstack
Copyright (c) 2012 - 2023 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
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)
# [![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)

## Java SDK for Contentstack

Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/).

Contentstack provides Java SDK to build application on top of Java. Given below is the detailed guide and helpful resources to get started with our Java SDK.


### Prerequisite

You will need JDK installed on your machine. You can install it from [here](http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html).
Expand All @@ -15,13 +14,14 @@ You will need JDK installed on your machine. You can install it from [here](http

To use the Contentstack Java SDK to your existing project, perform the steps given below:

Group id: `com.contentstack.sdk`
Group Id: ```com.contentstack.sdk```

Artifact Id: ```java```

Artifact id: `java`
[LATEST VERSION](https://search.maven.org/artifact/com.contentstack.sdk/java)

[{ version }](https://search.maven.org/artifact/com.contentstack.sdk/java)
#### Maven

1. **Maven**
```java
<dependency>
<groupId>com.contentstack.sdk</groupId>
Expand All @@ -30,7 +30,8 @@ Artifact id: `java`
</dependency>
```

2. **Gradle**
#### Gradle

```java
implementation 'com.contentstack.sdk:java:{version}'
```
Expand Down Expand Up @@ -59,19 +60,17 @@ Assets refer to all the media files (images, videos, PDFs, audio files, and so o

A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published. Learn how to work with [Environments](https://www.contentstack.com/docs/guide/environments).



### Contentstack Java SDK: 5-minute Quickstart

#### Initializing your SDK

To initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the snippet given below:

```java
Stack stack=Contentstack.stack("apiKey","accessToken","environment");
```
To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation, go to Settings &gt; Stack to view the API Key and Access Token.


To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation, go to Settings &gt; Stack to view the API Key and Access Token.

#### Querying content from your stack

Expand Down Expand Up @@ -101,7 +100,7 @@ To retrieve multiple entries of a particular content type, use the code snippet
Query query = stack.contentType("content_type_uid").query();
query.find(new QueryResultsCallBack(){
@Override
public void onCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
public void onCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
if(error == null){
//Success block
}else{
Expand All @@ -110,7 +109,6 @@ query.find(new QueryResultsCallBack(){
});
```


### Advanced Queries

You can query for content types, entries, assets and more using our Java API Reference.
Expand All @@ -121,7 +119,7 @@ You can query for content types, entries, assets and more using our Java API Ref

We have introduced Image Delivery APIs that let you retrieve images and then manipulate and optimize them for your digital properties. It lets you perform a host of other actions such as crop, trim, resize, rotate, overlay, and so on.

For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query parameters at the end of the image URL, such as, https://images.contentstack.io/v3/assets/download?crop=300,400. There are several more parameters that you can use for your images.
For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query parameters at the end of the image URL, such as, <https://images.contentstack.io/v3/assets/download?crop=300>,400. There are several more parameters that you can use for your images.

[Read Image Delivery API documentation](https://www.contentstack.com/docs/apis/image-delivery-api/).

Expand Down
30 changes: 16 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,41 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>1.10.1-SNAPSHOT</version>
<version>1.11.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API</description>
<url>https://github.com/contentstack/contentstack-java/</url>


<properties>
<sdk.version.release>1.10.1-SNAPSHOT</sdk.version.release>
<sdk.version.release>1.11.0-SNAPSHOT</sdk.version.release>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire-report-plugin.version>2.22.0</surefire-report-plugin.version>
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
<dotenv-source.version>2.2.4</dotenv-source.version>
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
<dotenv-source.version>2.3.1</dotenv-source.version>
<rxjava-source.version>3.1.5</rxjava-source.version>
<retrofit-source.version>2.9.0</retrofit-source.version>
<converter-gson-source.version>2.9.0</converter-gson-source.version>
<loggin.version>4.9.3</loggin.version>
<loggin.version>4.10.0</loggin.version>
<jococo-plugin.version>0.8.5</jococo-plugin.version>
<lombok-source.version>1.18.24</lombok-source.version>
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<junit-jupiter-engine.version>5.8.0-M1</junit-jupiter-engine.version>
<junit-vintage-engine.version>5.8.2</junit-vintage-engine.version>
<junit-vintage-engine.version>5.9.1</junit-vintage-engine.version>
<gson.version>2.8.8</gson.version>
<json-simple-version>1.1.1</json-simple-version>
<maven-site-plugin.version>3.3</maven-site-plugin.version>
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<json-version>20220320</json-version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<json-version>20220924</json-version>
<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
<maven-release-plugin-version>2.5.3</maven-release-plugin-version>
<nexus-staging-maven-plugin-version>1.6.7</nexus-staging-maven-plugin-version>
<contentstack-utils-version>1.1.2</contentstack-utils-version>
<contentstack-utils-version>1.2.0</contentstack-utils-version>
</properties>

<parent>
Expand Down Expand Up @@ -199,7 +197,8 @@
</execution>
</executions>
</plugin>

<!--Generate overview.html file-->
<!-- -overview "/Users/shaileshmishra/Documents/workspace/contentstack/javaspace/contentstack-java/src/main/overview.html" -bottom "<b>Copyright © 2012-2022 Contentstack </b><sup>TM</sup>" -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -211,6 +210,8 @@
<goal>jar</goal>
</goals>
<configuration>
<stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
<show>public</show>
<additionalOptions>-Xdoclint:none</additionalOptions>
<use>false</use>
<use>false</use>
Expand Down Expand Up @@ -279,7 +280,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin-version}</version>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down Expand Up @@ -342,6 +343,7 @@
<exclude>src/main/java/com/contentstack/sdk/FetchResultCallback.class</exclude>
<exclude>src/main/java/com/contentstack/sdk/EntryResultCallBack.class</exclude>
<exclude>src/main/java/com/contentstack/sdk/FetchResultCallback.class</exclude>
<exclude>src/main/java/com/contentstack/sdk/TestLivePreview.class</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Loading