|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dotmarketing.viewtools.content.ContentTool
public class ContentTool
The purpose of this class is to provide a way to easily search and interact with content and dotcms objects surrounding content from the front end of dotCMS. Previously dotCMS relayed on many macros to do things like search for content but because of the overhead of Velocity this can cause load and performance issues in certain cases. This tool should provide a cleaner way to interact with content without needing to parse tons of objects in Velocity. The tool is mapped in Velocity as $dotcontent
| Constructor Summary | |
|---|---|
ContentTool()
|
|
| Method Summary | |
|---|---|
long |
count(java.lang.String query)
Use this method to return the number of contents which match a particular query. |
ContentMap |
find(java.lang.String inodeOrIdentifier)
Will pull a single piece of content for you based on the inode or identifier. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getMostViewedContent(java.lang.String structureVariableName,
java.lang.String startDate,
java.lang.String endDate)
Gets the top viewed contents identifiers and numberOfViews for a particular structure for a specified date interval |
void |
init(java.lang.Object initData)
|
PaginatedArrayList<ContentMap> |
pull(java.lang.String query,
int offset,
int limit,
java.lang.String sort)
|
java.util.List<ContentMap> |
pull(java.lang.String query,
int limit,
java.lang.String sort)
Will return a ContentMap object which can be used on dotCMS front end. |
java.util.List<ContentMap> |
pull(java.lang.String query,
java.lang.String limit,
java.lang.String sort)
Will return a ContentMap object which can be used on dotCMS front end. |
PaginatedArrayList<ContentMap> |
pullPagenated(java.lang.String query,
int limit,
int offset,
java.lang.String sort)
Will return a ContentMap object which can be used on dotCMS front end. |
PaginatedContentList<ContentMap> |
pullPerPage(java.lang.String query,
int currentPage,
int contentsPerPage,
java.lang.String sort)
Works just similar to the pullPagenated. |
java.util.List<ContentMap> |
pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
boolean pullParents,
int limit)
Will return a ContentMap object which can be used on dotCMS front end. |
java.util.List<ContentMap> |
pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
boolean pullParents,
int limit,
java.lang.String sort)
Will return a ContentMap object which can be used on dotCMS front end. |
java.util.List<ContentMap> |
pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
java.lang.String condition,
boolean pullParents,
int limit,
java.lang.String sort)
Will return a ContentMap object which can be used on dotCMS front end. |
java.util.List<ContentletSearch> |
query(java.lang.String query,
int limit)
Will return a ContentSearch object which can be used on dotCMS front end. |
java.util.List<ContentletSearch> |
query(java.lang.String query,
int limit,
java.lang.String sort)
Will return a ContentSearch object which can be used on dotCMS front end. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentTool()
| Method Detail |
|---|
public void init(java.lang.Object initData)
init in interface org.apache.velocity.tools.view.tools.ViewToolpublic ContentMap find(java.lang.String inodeOrIdentifier)
inodeOrIdentifier - Can be either an Inode or Indentifier of content.
public java.util.List<ContentMap> pull(java.lang.String query,
java.lang.String limit,
java.lang.String sort)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memorysort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc"
public java.util.List<ContentMap> pull(java.lang.String query,
int limit,
java.lang.String sort)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memorysort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc"
public PaginatedArrayList<ContentMap> pull(java.lang.String query,
int offset,
int limit,
java.lang.String sort)
public PaginatedArrayList<ContentMap> pullPagenated(java.lang.String query,
int limit,
int offset,
java.lang.String sort)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memoryoffset - offset to start the results fromsort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc"
public PaginatedContentList<ContentMap> pullPerPage(java.lang.String query,
int currentPage,
int contentsPerPage,
java.lang.String sort)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedcurrentPage - Current page number for pagination the first page would be one.contentsPerPage - Number of contentlets you are displaying per pageoffset - offset to start the results fromsort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc"
public java.util.List<ContentletSearch> query(java.lang.String query,
int limit)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedlimit - 0 is the dotCMS max limit which is 10000.
public java.util.List<ContentletSearch> query(java.lang.String query,
int limit,
java.lang.String sort)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passedlimit - 0 is the dotCMS max limit which is 10000.sort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc"
public long count(java.lang.String query)
query - - Lucene Query used to search for content - Will append live, working, deleted, and language if not passed
public java.util.List<ContentMap> pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
boolean pullParents,
int limit)
relationshipName - - Name of the relationship as defined in the structure.contentletIdentifier - - Identifier of the contentletpullParents - Should the related pull be based on Parents or Childrenlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memory
DotSecurityException
DotDataException
public java.util.List<ContentMap> pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
boolean pullParents,
int limit,
java.lang.String sort)
relationshipName - - Name of the relationship as defined in the structure.contentletIdentifier - - Identifier of the contentletpullParents - Should the related pull be based on Parents or Childrenlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memorysort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc". Can be Null
DotSecurityException
DotDataException
public java.util.List<ContentMap> pullRelated(java.lang.String relationshipName,
java.lang.String contentletIdentifier,
java.lang.String condition,
boolean pullParents,
int limit,
java.lang.String sort)
relationshipName - - Name of the relationship as defined in the structure.contentletIdentifier - - Identifier of the contentletcondition - - Extra conditions to add to the query. like +title:Some Title. Can be NullpullParents - Should the related pull be based on Parents or Childrenlimit - 0 is the dotCMS max limit which is 10000. Becareful when searching for unlimited amount as all content will load into memorysort - - Velocity variable name to sort by. this is a string and can contain multiple values "sort1 acs, sort2 desc". Can be Null
DotSecurityException
DotDataException
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMostViewedContent(java.lang.String structureVariableName,
java.lang.String startDate,
java.lang.String endDate)
structureVariableName - startDate - endDate - user -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||