You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,17 @@
1
1
# Contentstack-Utils-Java
2
2
3
-
###Embedded Objects
3
+
## Embedded Objects
4
4
5
5
This guide will help you get started with Contentstack Java Utils SDK to build apps powered by Contentstack.
6
6
7
7
### Prerequisites
8
+
8
9
- JDK 8 or later
9
10
- Contentstack account
10
-
- Latest version of IntelliJ IDEA / Eclipse / VSCode / Spring Tool Suite
11
+
- Latest version of IntelliJ IDEA / eclipse / vscode / spring tool suite
11
12
12
13
### SDK Installation and Setup
14
+
13
15
To setup Utils SDK in your Java project, add the following dependency in the pom.xml file
14
16
15
17
```java
@@ -20,7 +22,6 @@ To setup Utils SDK in your Java project, add the following dependency in the pom
20
22
</dependency>
21
23
```
22
24
23
-
24
25
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
25
26
26
27
```java
@@ -31,11 +32,14 @@ If you are using Contentstack Java SDK, then the Utils SDK is already imported i
31
32
</dependency>
32
33
```
33
34
35
+
Download [{latest}](https://search.maven.org/artifact/com.contentstack.sdk/utils) dependency here
34
36
35
37
### Usage
38
+
36
39
Let’s learn how you can use Utils SDK to render embedded items.
37
40
38
41
### Create Render Option
42
+
39
43
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:
40
44
41
45
```java
@@ -90,12 +94,12 @@ public class DefaultOptionClass implements Option {
90
94
91
95
```
92
96
93
-
94
97
### Basic Queries
95
98
96
99
Contentstack Utils SDK lets you interact with the Content Delivery APIs and retrieve embedded items from the RTE field of an entry.
97
100
98
101
#### Fetch Embedded Item(s) from a Single Entry
102
+
99
103
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:
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:
0 commit comments