-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…29091) ### Proposed Changes * Include a new parameter on the category/children Endpoint, to look through the Entire tree https://github.com/dotCMS/core/pull/29091/files#diff-1677f12a3b6c8909f3436afc7817819af2f46ac5ae6a37bdfab43690ffa24780R242 *Include this parameter on the paginator also https://github.com/dotCMS/core/pull/29091/files#diff-693f0b4479466ce339fe60e74bc320dc80aa8ce835d8e6fd661b32bdba348419R67
- Loading branch information
1 parent
54611c0
commit 6704bda
Showing
9 changed files
with
800 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
...S/src/main/java/com/dotmarketing/portlets/categories/business/CategorySearchCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package com.dotmarketing.portlets.categories.business; | ||
|
||
import com.dotcms.util.pagination.OrderDirection; | ||
import com.dotmarketing.portlets.categories.model.Category; | ||
|
||
/** | ||
* Represents Search Criteria for {@link Category} searching, you cans set the follow: | ||
* | ||
* - filter: Value used to filter the Category by, returning only Categories that contain this value in their key, name, or variable name. | ||
* - inode: Entry point on the Category tree to start the searching. | ||
* - orderBy: Field name to order the Category | ||
* - direction: Order by direction, it can be 'ASC' or 'DESC' | ||
* - rootInode: If the root inode is set, the search will be conducted only among the children of this category. | ||
* Otherwise, the search will include only the top-level categories. | ||
*/ | ||
public class CategorySearchCriteria { | ||
final String rootInode; | ||
final String filter; | ||
final String orderBy; | ||
final OrderDirection direction; | ||
final int limit; | ||
final int offset; | ||
private CategorySearchCriteria (final Builder builder) { | ||
this.rootInode = builder.rootInode; | ||
this.filter = builder.filter; | ||
this.orderBy = builder.orderBy; | ||
this.direction = builder.direction; | ||
this.limit = builder.limit; | ||
this.offset = builder.offset; | ||
} | ||
|
||
public String getRootInode() { | ||
return rootInode; | ||
} | ||
|
||
public String getFilter() { | ||
return filter; | ||
} | ||
|
||
public String getOrderBy() { | ||
return orderBy; | ||
} | ||
|
||
public OrderDirection getDirection() { | ||
return direction; | ||
} | ||
|
||
public int getLimit() { | ||
return limit; | ||
} | ||
|
||
public int getOffset() { | ||
return offset; | ||
} | ||
|
||
public static class Builder { | ||
private String rootInode; | ||
private String filter; | ||
private String orderBy = "category_name"; | ||
private OrderDirection direction = OrderDirection.ASC; | ||
private int limit = -1; | ||
private int offset = 0; | ||
|
||
public Builder rootInode(String rootInode) { | ||
this.rootInode = rootInode; | ||
return this; | ||
} | ||
|
||
public Builder filter(String filter) { | ||
this.filter = filter; | ||
return this; | ||
} | ||
|
||
public Builder orderBy(String orderBy) { | ||
this.orderBy = orderBy; | ||
return this; | ||
} | ||
|
||
public Builder direction(OrderDirection direction) { | ||
this.direction = direction; | ||
return this; | ||
} | ||
|
||
public Builder limit(int limit) { | ||
this.limit = limit; | ||
return this; | ||
} | ||
|
||
public Builder offset(int offset) { | ||
this.offset = offset; | ||
return this; | ||
} | ||
|
||
|
||
public CategorySearchCriteria build() { | ||
return new CategorySearchCriteria(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.