Skip to content

Commit fd71fa2

Browse files
Merge pull request #3 from contentstack/dev
transitive vulnerable dependencies removed
2 parents e73ca3d + 985204e commit fd71fa2

40 files changed

+2345
-1710
lines changed

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
### Code-Java ###
22
# Language Support for Java(TM) by Red Hat extension for Visual Studio Code - https://marketplace.visualstudio.com/items?itemName=redhat.java
33

4+
.dccache
45
.project
56
.classpath
67
factoryConfiguration.json
8+
.vscode
9+
.vscode/
710

811
### Eclipse ###
912
.metadata
@@ -13,10 +16,15 @@ tmp/
1316
*.bak
1417
*.swp
1518
*~.nib
19+
.env
20+
.env/
21+
.talismanrc
1622
local.properties
1723
.settings/
1824
.loadpath
1925
.recommenders
26+
.dccache/
27+
.dccache
2028

2129
# External tool builders
2230
.externalToolBuilders/
@@ -191,7 +199,7 @@ Icon
191199
# Thumbnails
192200
._*
193201

194-
# ReadResource that might appear in the root of a volume
202+
# com.contentstack.utils.ReadResource that might appear in the root of a volume
195203
.DocumentRevisions-V100
196204
.fseventsd
197205
.Spotlight-V100
@@ -260,3 +268,4 @@ gradle-app.setting
260268
java.iml
261269
src/main/resources/
262270
!/.idea/
271+
.dccache

.talismanrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
threshold: medium
2+
3+
fileignoreconfig:
4+
5+
- filename: .dccache
6+
checksum: 140eb49c2bad3edadf62c926625f3bb304e904c38f2a9a5a57e9f6dc7163f61e

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
11
# Contentstack-Utils-Java
22

3-
### Embedded Objects
3+
## Embedded Objects
44

55
This guide will help you get started with Contentstack Java Utils SDK to build apps powered by Contentstack.
66

77
### Prerequisites
8+
89
- JDK 8 or later
910
- Contentstack account
10-
- Latest version of IntelliJ IDEA / Eclipse / VSCode / Spring Tool Suite
11+
- Latest version of IntelliJ IDEA / eclipse / vscode / spring tool suite
1112

1213
### SDK Installation and Setup
14+
1315
To setup Utils SDK in your Java project, add the following dependency in the pom.xml file
1416

1517
```java
1618
<dependency>
1719
<groupId>com.contentstack.sdk</groupId>
1820
<artifactId>util</artifactId>
19-
<version>latest</version>
21+
<version>{latest}</version>
2022
</dependency>
2123
```
2224

23-
2425
If you are using Contentstack Java SDK, then the Utils SDK is already imported into your project, and the dependency snippet will look as below
2526

2627
```java
2728
<dependency>
2829
<groupId>com.contentstack.sdk</groupId>
2930
<artifactId>java</artifactId>
30-
<version>latest</version>
31+
<version>{latest}</version>
3132
</dependency>
3233
```
3334

35+
Download [{latest}](https://search.maven.org/artifact/com.contentstack.sdk/utils) dependency here
3436

3537
### Usage
38+
3639
Let’s learn how you can use Utils SDK to render embedded items.
3740

3841
### Create Render Option
42+
3943
To render embedded items on the front-end, use the renderContents function, and define the UI elements you want to show in the front-end of your website, as shown in the example code below:
4044

4145
```java
@@ -90,12 +94,12 @@ public class DefaultOptionClass implements Option {
9094

9195
```
9296

93-
9497
### Basic Queries
9598

9699
Contentstack Utils SDK lets you interact with the Content Delivery APIs and retrieve embedded items from the RTE field of an entry.
97100

98101
#### Fetch Embedded Item(s) from a Single Entry
102+
99103
To get an embedded item of a single entry, you need to provide the stack API key, environment name, delivery token, content type’s UID and entry’s UID. Then, use the includeEmbeddedItems function as shown below:
100104

101105
```java
@@ -116,14 +120,13 @@ entry.fetch(new EntryResultCallBack() {
116120
JSONObject jsonObject = entry.toJSON();
117121
Utils.render(jsonObject, keyPath, new Option());
118122
} else {
119-
[Error block] // handle your error
123+
[Error block] // handle your error
120124
}}
121125
});
122126
```
123127

124-
125-
126128
#### Fetch Embedded Item(s) from Multiple Entries
129+
127130
To get embedded items from multiple entries, you need to provide the stack API key, environment name, delivery token, and content type’s UID.
128131

129132
```java
@@ -145,12 +148,13 @@ query.find(new QueryResultsCallBack() {
145148
Utils.render(jsonObject, keyPath, new Option());
146149
}
147150
}else{
148-
[Error block] // handle your error
151+
[Error block] // handle your error
149152
}}
150153
});
151154
```
152155

153156
#### Render JSON RTE Contents
157+
154158
To get multiple entries, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use the Utils.jsonToHTML function as shown below:
155159

156160
```java
@@ -175,6 +179,3 @@ query.find(new QueryResultsCallBack() {
175179
});
176180

177181
```
178-
179-
180-

pom.xml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64

75
<groupId>com.contentstack.sdk</groupId>
86
<artifactId>utils</artifactId>
9-
<version>1.0.0-SNAPSHOT</version>
7+
<version>1.1.1-SNAPSHOT</version>
108
<packaging>jar</packaging>
119
<name>Contentstack-utils</name>
1210
<description>Java Utils SDK for Contentstack Content Delivery API, Contentstack is a headless CMS with an API-first approach</description>
1311
<url>https://www.***REMOVED***</url>
1412

1513
<properties>
16-
<util.version>1.0.0-SNAPSHOT</util.version>
14+
<util.version>1.1.1-SNAPSHOT</util.version>
1715
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1816
<project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding>
1917
<maven.compiler.source>1.8</maven.compiler.source>
@@ -23,8 +21,10 @@
2321
<surefire-report-plugin.version>2.22.0</surefire-report-plugin.version>
2422
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
2523
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
26-
<kotlin-test-junit.version>1.4.10</kotlin-test-junit.version>
27-
<junit.version>4.13.1</junit.version>
24+
<kotlin-test-junit.version>1.6.21</kotlin-test-junit.version>
25+
<junit.version>4.13.2</junit.version>
26+
<jsoup.version>1.14.3</jsoup.version>
27+
<json.simple.version>1.1.1</json.simple.version>
2828
<maven-site-plugin.version>3.3</maven-site-plugin.version>
2929
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
3030
<nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
@@ -86,6 +86,7 @@
8686
<groupId>org.jetbrains.kotlin</groupId>
8787
<artifactId>kotlin-stdlib-jdk8</artifactId>
8888
<version>${kotlin-test-junit.version}</version>
89+
<scope>compile</scope>
8990
</dependency>
9091
<dependency>
9192
<groupId>org.jetbrains.kotlin</groupId>
@@ -96,17 +97,30 @@
9697
<dependency>
9798
<groupId>org.jsoup</groupId>
9899
<artifactId>jsoup</artifactId>
99-
<version>1.14.2</version>
100+
<version>${jsoup.version}</version>
101+
<scope>compile</scope>
100102
</dependency>
101103
<dependency>
102104
<groupId>org.json</groupId>
103105
<artifactId>json</artifactId>
104-
<version>20180130</version>
106+
<version>20220320</version>
107+
<scope>compile</scope>
108+
</dependency>
109+
<dependency>
110+
<groupId>com.googlecode.json-simple</groupId>
111+
<artifactId>json-simple</artifactId>
112+
<version>${json.simple.version}</version>
113+
<scope>compile</scope>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.springframework</groupId>
117+
<artifactId>spring-web</artifactId>
118+
<version>5.3.20</version>
119+
<scope>compile</scope>
105120
</dependency>
106121
</dependencies>
107122

108123
<build>
109-
<sourceDirectory>src/main/java</sourceDirectory>
110124
<plugins>
111125
<plugin>
112126
<groupId>org.jacoco</groupId>
@@ -235,13 +249,13 @@
235249
<goals>deploy</goals>
236250
</configuration>
237251
</plugin>
238-
239252
<plugin>
240253
<groupId>org.jetbrains.kotlin</groupId>
241254
<artifactId>kotlin-maven-plugin</artifactId>
242255
<version>${kotlin-test-junit.version}</version>
243256
<executions>
244257
<execution>
258+
<?m2e execute onConfiguration,onIncremental?>
245259
<id>compile</id>
246260
<phase>process-sources</phase>
247261
<goals>
@@ -250,6 +264,7 @@
250264
</execution>
251265
</executions>
252266
</plugin>
267+
253268
</plugins>
254269
</build>
255270

0 commit comments

Comments
 (0)