Skip to content

Commit 5619159

Browse files
Merge pull request #48 from contentstack/next
Next: search filter in Taxonomy
2 parents b05d752 + c901fe8 commit 5619159

File tree

15 files changed

+132
-18
lines changed

15 files changed

+132
-18
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2012 - 2023 Contentstack
3+
Copyright (c) 2012 - 2024 Contentstack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if(response.isSuccessful()){
137137

138138
### The MIT License (MIT)
139139

140-
Copyright © 2012-2023 [Contentstack](https://www.contentstack.com/). All Rights Reserved
140+
Copyright © 2012-2024 [Contentstack](https://www.contentstack.com/). All Rights Reserved
141141

142142
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
143143
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

changelog.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
11
# Changelog
22

3+
## v1.3.0
4+
5+
### Jan 18, 2024
6+
7+
- New Features:
8+
- Query filter support in Taxonomy
9+
- query filter support in Entry
10+
- query filter support in Taxonomy
11+
12+
## v1.2.0
13+
14+
### Dec 18, 2023
15+
16+
- New Features:
17+
- Early access header support
18+
19+
## v1.1.0
20+
21+
### Oct 31, 2023
22+
23+
- New Features:
24+
- Taxonomy
25+
- Teams
26+
27+
Bug Fixes:
28+
29+
- KeepAliveDuration
30+
- SNYK issues fixed
31+
332
## v1.0.0
433

534
### Aug 01, 2023
35+
636
- Bug Fixed For un-localize An Entry
737
- Fixed Timeout Issue
8-
- #32 Fixed
38+
- #32 Fixed
939
- Code coverage improvements
1040
- NRP support added
1141
- General improvements with minor breaking changes
@@ -15,4 +45,5 @@
1545
### Initial Release
1646

1747
### Oct 20, 2022
48+
1849
Initial release for Contentstack CMA base Java management SDK

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<artifactId>cms</artifactId>
88
<packaging>jar</packaging>
99
<name>contentstack-management-java</name>
10-
<version>1.1.0</version>
10+
<version>1.3.0</version>
1111
<description>Contentstack Java Management SDK for Content Management API, Contentstack is a headless CMS with an
1212
API-first approach
1313
</description>

src/main/java/com/contentstack/cms/core/Util.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
public class Util {
1717

18-
// The line `public static final String SDK_VERSION = "1.0.0";`
18+
// The line `public static final String SDK_VERSION = "1.3.0";`
1919
// named `SDK_VERSION` of type `String`. The value of this constant is set to
20-
// "1.0.0".
21-
public static final String SDK_VERSION = "1.0.0";
20+
// "1.2.0".
21+
public static final String SDK_VERSION = "1.3.0";
2222

2323
static final String PRIVATE_CONSTRUCTOR = "private constructor can't be accessed outside the class";
2424
public static final Boolean RETRY_ON_FAILURE = true;

src/main/java/com/contentstack/cms/stack/Entry.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,12 +744,12 @@ public Call<ResponseBody> publishWithReference(@NotNull JSONObject requestBody)
744744
}
745745

746746
/**
747-
* To Unpublish an entry call will unpublish an entry at once, and also, gives
748-
* you the provision to unpublish an
747+
* To Un-publish an entry call will un-publish an entry at once, and also, gives
748+
* you the provision to un-publish an
749749
* entry automatically at a later date/time.
750750
* <p>
751751
* In the 'Body' section, you can specify the locales and environments from
752-
* which you want to unpublish the entry.
752+
* which you want to un-publish the entry.
753753
* These details should be specified in the
754754
* <p>
755755
* <b>entry</b> parameter. However, if
@@ -778,4 +778,22 @@ public Call<ResponseBody> unpublish(@NotNull JSONObject requestBody) {
778778
return this.service.unpublish(this.headers, this.contentTypeUid, this.entryUid, requestBody);
779779
}
780780

781+
782+
/**
783+
* Get instance of taxonomy search filter class instance through which we can query on taxonomy based on content type
784+
* <p><b>Examples</b></p>
785+
* <pre>
786+
* JSONObject query = new JSONObject();
787+
* query.put("taxonomies.taxonomy_uid", "{ \"$in\" : [\"term_uid1\" , \"term_uid2\" ] }");
788+
* Call response = entry.query(query).execute();
789+
* </pre>
790+
*
791+
* @param query the request body of type {@link JSONObject}
792+
* @return instance of {@link Terms}
793+
*/
794+
public Call<ResponseBody> query(@NotNull JSONObject query) {
795+
validateCT();
796+
return this.service.filterTaxonomy(this.headers, this.contentTypeUid, query);
797+
}
798+
781799
}

src/main/java/com/contentstack/cms/stack/EntryService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,11 @@ Call<ResponseBody> unpublish(
146146
@Path("content_type_uid") String contentTypeUid,
147147
@Path("entry_uid") String entryUid,
148148
@Body JSONObject requestBody);
149+
150+
@GET("content_types/{content_type_uid}/entries")
151+
Call<ResponseBody> filterTaxonomy(
152+
@HeaderMap Map<String, Object> headers,
153+
@Path("content_type_uid") String contentTypeUid,
154+
@Query("query") JSONObject queryObject);
155+
149156
}

src/main/java/com/contentstack/cms/stack/Locale.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import java.util.Map;
1212

1313
/**
14-
* <b>Languages</b>
15-
* <br>
1614
* Contentstack has a sophisticated multilingual capability. It allows you to
1715
* create and publish entries in any
1816
* language. This feature allows you to set up multilingual websites and cater

src/main/java/com/contentstack/cms/stack/ManagementToken.java

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

1111
/**
12-
* <b>Management tokens: </b> <br>
1312
* To authenticate Content Management API (CMA) requests over your stack
1413
* content, you can use Management Tokens
1514
* <br>

src/main/java/com/contentstack/cms/stack/Taxonomy.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,19 @@ public Terms terms() {
251251
return new Terms(this.taxonomyService, this.headers, this.taxonomyId);
252252
}
253253

254+
255+
/**
256+
* Get instance of taxonomy search filter class instance through which we can query on taxonomy based on Entry
257+
* <p>Example usage:</p>
258+
* <pre>JSONObject object = new JSonObject();</pre>
259+
* <pre>object.put("taxonomies.color", Object)</pre>
260+
* <pre>Taxonomy taxonomy = stack("authtoken").taxonomy("taxonomyId").filterTaxonomy(object);</pre>
261+
*
262+
* @param query the query of type @{@link JSONObject}
263+
* @return instance of {@link Call}
264+
*/
265+
public Call<ResponseBody> query(JSONObject query) {
266+
return this.taxonomyService.filterTaxonomy(this.headers, query);
267+
}
268+
254269
}

0 commit comments

Comments
 (0)