com.dotmarketing.viewtools
Class ContentsWebAPI

java.lang.Object
  extended by com.dotmarketing.viewtools.ContentsWebAPI
All Implemented Interfaces:
org.apache.velocity.tools.view.tools.ViewTool

public class ContentsWebAPI
extends java.lang.Object
implements org.apache.velocity.tools.view.tools.ViewTool


Constructor Summary
ContentsWebAPI()
           
 
Method Summary
 boolean doesUserHasPermission(long contentInode, int permission)
          Deprecated.  
 boolean doesUserHasPermission(long contentInode, int permission, boolean editMode)
          Deprecated.  
 boolean doesUserHasPermission(long contentInode, int permission, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Deprecated.  
 boolean doesUserHasPermission(java.lang.String contentInode, int permission)
          This method checks if the logged in user (frontend) has the required permission over the passed contentlet id
 boolean doesUserHasPermission(java.lang.String contentInode, int permission, boolean editMode)
          This method checks if the logged in user (frontend) has the required permission over the passed contentlet id
 boolean doesUserHasPermission(java.lang.String contentInode, int permission, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method checks if the logged in user (frontend) has the required permission over the passed contentlet id
 java.util.List<java.lang.String> findFieldValues(java.lang.String structureName, java.lang.String fieldName, com.liferay.portal.model.User user)
          This method return the possible values in a field of all the contents of the specified structure
 java.util.List<Contentlet> getAllRelatedContent(java.lang.String relationshipName, java.lang.String contentletInode)
           
 CategoryAPI getCategoryAPI()
           
 Contentlet getContentByInode(long inode)
          Deprecated.  
 Contentlet getContentByInode(java.lang.String inode)
           
 Identifier getContentIdentifier(Contentlet cont)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 java.util.List<java.lang.String> getContentIdentifiersFromLuceneHits(LuceneHits assets)
          This methods retrieves the identifier for a list of contents hits retrieved from lucene this method is used in the dynamic containers code to get the list of contents
 ContentletAPI getContentletAPI()
           
 java.lang.String getContentletByUrl(HttpServletRequest request, java.lang.String structureName, java.lang.String fieldName)
          This methods matches the browsers URL to a contentlet field and returns the contentlet with the closest match.
 java.util.List<Category> getContentletCategories(java.lang.String inode)
           
 java.util.List<Contentlet> getContentletsByStructureAndOrder(Structure structure, java.lang.String orderFieldName, java.lang.String direction, int rowNumber)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 java.util.List<Contentlet> getContents(java.lang.String structureType, java.lang.String categoryName)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 java.util.List<Contentlet> getContentsByStructureAndFieldValue(Structure structure, java.lang.String fieldName, java.lang.String fieldValue)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 java.util.List<java.lang.String> getContentsPathsFromLuceneHits(LuceneHits assets, boolean working)
          This methods retrieves the disk paths for a list of contents hits retrieved from lucene this method is used in the dynamic containers code to get the list of contents paths
 java.util.List getEmptyList()
           
 java.util.Map getEmptyMap()
           
 Field getFieldByInode(long structureInode, java.lang.String fieldName)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 Field getFieldByInode(java.lang.String structureInode, java.lang.String fieldName)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 Field getFieldByLogicalName(java.lang.String structureType, java.lang.String fieldName)
          This methods retrieves the field of an structure based on his logical name.
 Field getFieldByLogicalName(Structure st, java.lang.String fieldName)
          This methods retrieves the field of an structure based on his logical name.
 Field getFieldByLogicalNameAndInode(long structureInode, java.lang.String fieldName)
          This methods retrieves the field of an structure based on his logical name.
 Field getFieldByLogicalNameAndInode(java.lang.String structureInode, java.lang.String fieldName)
          This methods retrieves the field of an structure based on his logical name.
 Field getFieldByName(java.lang.String structureType, java.lang.String fieldName)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName
 Field getFieldByName(Structure st, java.lang.String fieldName)
          Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead
 java.lang.Object getFieldValue(java.lang.String fieldName, Contentlet content)
          Deprecated. Try using the #getContentDetail or #getContentDetailByIdentifier macros to retrieve the fields of a content.
 java.util.List<Contentlet> getLastestContents(java.lang.String structureType, java.lang.String categoryName)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 java.util.List<Contentlet> getLastestContents(java.lang.String structureType, java.lang.String categoryName, int maxResults)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 java.util.List<Contentlet> getLastestContents(Structure structure, Category category)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 java.util.List<Contentlet> getLastestContents(Structure structure, Category category, int maxResults)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 java.util.List<Contentlet> getRelatedChildContent(java.lang.String relationshipName, java.lang.String contentletInode)
           
 java.util.List<Contentlet> getRelatedContentlets(long relationshipInode, long contentletInode, boolean hasParent)
          Deprecated. 
static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship, Contentlet contentlet, boolean hasParent)
          This methods retrieve the list of related contentlets in a relationship of a given contentlet
 java.util.List<Contentlet> getRelatedContentlets(java.lang.String relationshipInode, java.lang.String contentletInode, boolean hasParent)
           
 java.util.List<Contentlet> getRelatedContentletsByCondition(java.lang.String relationshipInode, java.lang.String contentletInode, boolean hasParent, java.lang.String condition)
           
 java.util.List<Contentlet> getRelatedParentContent(java.lang.String relationshipName, java.lang.String contentletInode)
           
 Relationship getRelationshipByName(java.lang.String relationshipName)
          This method retrieves the relationship by relation type value = relationship name
 java.util.List<Relationship> getRelationshipsOfContentlet(Contentlet cont)
          This methods gets the list of all the relationship objects associated to the structure of the contentlet as a parent or a child
 java.util.List<Relationship> getRelationshipsOfContentlet(Contentlet cont, boolean hasParent)
          This gets the list of all the relationship objects associated to the structure of the contentlet
 java.util.List<Relationship> getRelationshipsOfContentlet(long contentletInode)
          Deprecated. 
 java.util.List<Relationship> getRelationshipsOfContentlet(long contentletInode, boolean hasParent)
          Deprecated. 
 java.util.List<Relationship> getRelationshipsOfContentlet(java.lang.String contentletInode)
           
 java.util.List<Relationship> getRelationshipsOfContentlet(java.lang.String contentletInode, boolean hasParent)
           
 java.util.List<Relationship> getRelationshipsOfStructure(long structureInode, boolean hasParent)
          Deprecated. 
 java.util.List<Relationship> getRelationshipsOfStructure(java.lang.String structureInode, boolean hasParent)
          Deprecated. 
 java.util.List<Relationship> getRelationshipsOfStructure(Structure st, boolean hasParent)
          Deprecated. this methods could be found on StructuresWebAPI
 Structure getStructureByInode(java.lang.String structureInode)
          Get the Structure from cache by inode
 Structure getStructureByType(java.lang.String structureType)
          Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.
 void init(java.lang.Object obj)
          Initializes this instance using the given data
static boolean isChildOfTheRelationship(Contentlet contentlet, Relationship relationship)
          This methods checks if the given contentlet has the role of child of the given relationship
 boolean isChildOfTheRelationship(long contentletInode, long relationshipInode)
          Deprecated. 
 boolean isChildOfTheRelationship(java.lang.String contentletInode, java.lang.String relationshipInode)
           
 boolean isContentletIdentifierOrInode(java.lang.String id)
          This method return if a identifier or inode is from a contentlet object.
static boolean isParentOfTheRelationship(Contentlet contentlet, Relationship relationship)
          This methods checks if the given contentlet has the role of parent of the given relationship
 boolean isParentOfTheRelationship(long contentletInode, long relationshipInode)
          Deprecated. 
 boolean isParentOfTheRelationship(java.lang.String contentletInode, java.lang.String relationshipInode)
           
 java.util.HashMap pageContent(java.lang.String query, java.lang.String sortBy, java.lang.String perPage, java.lang.String currentPageNumber)
          This method pulls dynamic lists of content in the form of maps for the front end of the web site using pagination.
 java.util.List pullContent(java.lang.String query, java.lang.String lim, java.lang.String sortBy)
           
 java.util.List pullContent(java.lang.String query, java.lang.String lim, java.lang.String sortBy, java.lang.Boolean editMode)
           
 java.util.List pullPersonalizedContentByCategories(java.lang.String query, java.lang.String lim, java.lang.String sortBy, java.util.List categoryList)
           
 java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName, long contentletInode, int limit, java.lang.String orderBy)
          Deprecated.  
 java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName, java.lang.String contentletInode, int limit, java.lang.String orderBy)
          This method is used by the pullRelatedContent macro to retrieve related content and display it in a page
 java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName, java.lang.String contentletInode, java.lang.String limit, java.lang.String orderBy)
          This method is used by the pullRelatedContent macro to retrieve related content and display it in a page
 java.util.List randomizeList(java.util.List list, java.lang.String limit)
           
 java.util.HashMap searchWithLuceneQuery(java.lang.String structureType, java.lang.String luceneCondition, java.lang.String sortBy, int maxResults)
           
 java.util.HashMap searchWithLuceneQuery(java.lang.String structureType, java.lang.String luceneCondition, java.lang.String sortBy, int maxResults, int page, int pageSize)
           
 java.util.HashMap searchWithLuceneQuery(java.lang.String structureType, java.lang.String luceneCondition, java.lang.String sortBy, java.lang.String pageStr, java.lang.String rowsPerPage)
          This method searches inside the lucene index for contents, this methods uses the contentlet database names of the fields in the condition and the sort by field so you should convert the display names of the fields to the contentlet fields names before call this method
 void setCategoryAPI(CategoryAPI categoryAPI)
           
 void setContentletAPI(ContentletAPI conAPI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentsWebAPI

public ContentsWebAPI()
Method Detail

init

public void init(java.lang.Object obj)
Description copied from interface: org.apache.velocity.tools.view.tools.ViewTool
Initializes this instance using the given data

Specified by:
init in interface org.apache.velocity.tools.view.tools.ViewTool
Parameters:
obj - the initialization data

getCategoryAPI

public CategoryAPI getCategoryAPI()

setCategoryAPI

public void setCategoryAPI(CategoryAPI categoryAPI)

getContentletAPI

public ContentletAPI getContentletAPI()

setContentletAPI

public void setContentletAPI(ContentletAPI conAPI)

getContentIdentifier

public Identifier getContentIdentifier(Contentlet cont)
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
cont -
Returns:

getContentByInode

public Contentlet getContentByInode(long inode)
                             throws DotDataException,
                                    DotSecurityException
Deprecated. 

Parameters:
inode -
Returns:
Throws:
DotSecurityException
DotDataException

getContentByInode

public Contentlet getContentByInode(java.lang.String inode)
                             throws DotDataException,
                                    DotSecurityException
Parameters:
inode -
Returns:
Throws:
DotSecurityException
DotDataException

getStructureByType

public Structure getStructureByType(java.lang.String structureType)
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
structureType -
Returns:

getStructureByInode

public Structure getStructureByInode(java.lang.String structureInode)
Get the Structure from cache by inode

Parameters:
structureInode -
Returns:
Structure
Since:
1.5

getLastestContents

public java.util.List<Contentlet> getLastestContents(Structure structure,
                                                     Category category,
                                                     int maxResults)
                                              throws DotDataException,
                                                     DotSecurityException,
                                                     ParseException
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
structure -
category -
maxResults -
Returns:
Throws:
ParseException
DotSecurityException
DotDataException

getLastestContents

public java.util.List<Contentlet> getLastestContents(java.lang.String structureType,
                                                     java.lang.String categoryName,
                                                     int maxResults)
                                              throws DotDataException,
                                                     DotSecurityException,
                                                     ParseException
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
structureType -
categoryName -
maxResults -
Returns:
Throws:
DotDataException
DotSecurityException
ParseException

getLastestContents

public java.util.List<Contentlet> getLastestContents(Structure structure,
                                                     Category category)
                                              throws DotDataException,
                                                     DotSecurityException,
                                                     ParseException
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
structure -
category -
Returns:
Throws:
ParseException
DotSecurityException
DotDataException

getLastestContents

public java.util.List<Contentlet> getLastestContents(java.lang.String structureType,
                                                     java.lang.String categoryName)
                                              throws DotDataException,
                                                     DotSecurityException,
                                                     ParseException
Deprecated. this methods was deprecated because it hits the database, try to use the lucene search methods instead.

Parameters:
structureType -
categoryName -
Returns:
Throws:
DotDataException
DotSecurityException
ParseException

getFieldByName

public Field getFieldByName(Structure st,
                            java.lang.String fieldName)
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead

This methods retrieves the field of an structure based on his presentation name

Parameters:
st - Structure owner of the field
fieldName - The presentation name of the field
Returns:
The field found

getFieldByName

public Field getFieldByName(java.lang.String structureType,
                            java.lang.String fieldName)
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

This methods retrieves the field of an structure based on his presentation name

Parameters:
structureType - The structure type name
fieldName - The presentation name of the field
Returns:
The field found

getFieldByInode

public Field getFieldByInode(long structureInode,
                             java.lang.String fieldName)
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

This methods retrieves the field of an structure based on his presentation name

Parameters:
structureInode - The structure inode
fieldName - The presentation name of the field
Returns:
The field found

getFieldByInode

public Field getFieldByInode(java.lang.String structureInode,
                             java.lang.String fieldName)
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

This methods retrieves the field of an structure based on his presentation name

Parameters:
structureInode - The structure inode
fieldName - The presentation name of the field
Returns:
The field found

getFieldByLogicalName

public Field getFieldByLogicalName(Structure st,
                                   java.lang.String fieldName)
This methods retrieves the field of an structure based on his logical name. E.G. Last_Name

Parameters:
st - Structure owner of the field
fieldName - The presentation name of the field
Returns:
The field found, an empty field if it wasn't found

getFieldByLogicalName

public Field getFieldByLogicalName(java.lang.String structureType,
                                   java.lang.String fieldName)
This methods retrieves the field of an structure based on his logical name. E.G. Last_Name

Parameters:
structureType - The structure type name
fieldName - The presentation name of the field
Returns:
The field found, an empty field if it wasn't found

getFieldByLogicalNameAndInode

public Field getFieldByLogicalNameAndInode(long structureInode,
                                           java.lang.String fieldName)
This methods retrieves the field of an structure based on his logical name. E.G. Last_Name

Parameters:
structureInode - The structure inode
fieldName - The presentation name of the field
Returns:
The field found, an empty field if it wasn't found

getFieldByLogicalNameAndInode

public Field getFieldByLogicalNameAndInode(java.lang.String structureInode,
                                           java.lang.String fieldName)
This methods retrieves the field of an structure based on his logical name. E.G. Last_Name

Parameters:
structureInode - The structure inode
fieldName - The presentation name of the field
Returns:
The field found, an empty field if it wasn't found

getFieldValue

public java.lang.Object getFieldValue(java.lang.String fieldName,
                                      Contentlet content)
Deprecated. Try using the #getContentDetail or #getContentDetailByIdentifier macros to retrieve the fields of a content.

Parameters:
fieldName -
content -
Returns:

getContentsByStructureAndFieldValue

public java.util.List<Contentlet> getContentsByStructureAndFieldValue(Structure structure,
                                                                      java.lang.String fieldName,
                                                                      java.lang.String fieldValue)
                                                               throws DotDataException,
                                                                      DotSecurityException,
                                                                      ParseException
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

Parameters:
structure -
fieldName -
fieldValue -
Returns:
Throws:
ParseException
DotSecurityException
DotDataException

getContentletsByStructureAndOrder

public java.util.List<Contentlet> getContentletsByStructureAndOrder(Structure structure,
                                                                    java.lang.String orderFieldName,
                                                                    java.lang.String direction,
                                                                    int rowNumber)
                                                             throws DotDataException,
                                                                    DotSecurityException,
                                                                    ParseException
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

Parameters:
structure -
orderFieldName -
direction -
rowNumber -
Returns:
Throws:
ParseException
DotSecurityException
DotDataException

getContents

public java.util.List<Contentlet> getContents(java.lang.String structureType,
                                              java.lang.String categoryName)
                                       throws DotDataException,
                                              DotSecurityException,
                                              ParseException
Deprecated. This method was deprecated because it uses the presentation name of the field we encourage the use of the logical name of the field instead @see getFieldByLogicalName

Parameters:
structureType -
categoryName -
Returns:
Throws:
DotDataException
DotSecurityException
ParseException

searchWithLuceneQuery

public java.util.HashMap searchWithLuceneQuery(java.lang.String structureType,
                                               java.lang.String luceneCondition,
                                               java.lang.String sortBy,
                                               java.lang.String pageStr,
                                               java.lang.String rowsPerPage)
                                        throws ParseException,
                                               DotSecurityException
This method searches inside the lucene index for contents, this methods uses the contentlet database names of the fields in the condition and the sort by field so you should convert the display names of the fields to the contentlet fields names before call this method

Parameters:
structureType - The name or inode of the structure, E.G: "Web Page Content" or 12354
luceneCondition - The lucene query E.G. +text1:test text2:you
sortBy - The field used to sort you can also use the desc or asc suffix, E.G: text1 desc
pageStr - The page you want to display
rowsPerPage - The number of records you want to show per page.
Returns:
Throws:
ParseException
DotSecurityException

searchWithLuceneQuery

public java.util.HashMap searchWithLuceneQuery(java.lang.String structureType,
                                               java.lang.String luceneCondition,
                                               java.lang.String sortBy,
                                               int maxResults)
                                        throws ParseException,
                                               DotSecurityException
Throws:
ParseException
DotSecurityException

searchWithLuceneQuery

public java.util.HashMap searchWithLuceneQuery(java.lang.String structureType,
                                               java.lang.String luceneCondition,
                                               java.lang.String sortBy,
                                               int maxResults,
                                               int page,
                                               int pageSize)
                                        throws ParseException,
                                               DotSecurityException
Throws:
ParseException
DotSecurityException

getContentsPathsFromLuceneHits

public java.util.List<java.lang.String> getContentsPathsFromLuceneHits(LuceneHits assets,
                                                                       boolean working)
This methods retrieves the disk paths for a list of contents hits retrieved from lucene this method is used in the dynamic containers code to get the list of contents paths

Parameters:
assets - The assets hits
working - True if you want the working path to the content file, false if you the live path to the file
Returns:
A list of paths to the contents

getContentIdentifiersFromLuceneHits

public java.util.List<java.lang.String> getContentIdentifiersFromLuceneHits(LuceneHits assets)
This methods retrieves the identifier for a list of contents hits retrieved from lucene this method is used in the dynamic containers code to get the list of contents

Parameters:
assets - The assets hits
Returns:
A list of identifier to the contents

getContentletCategories

public java.util.List<Category> getContentletCategories(java.lang.String inode)
                                                 throws DotDataException,
                                                        DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelationshipByName

public Relationship getRelationshipByName(java.lang.String relationshipName)
This method retrieves the relationship by relation type value = relationship name


getRelationshipsOfContentlet

public java.util.List<Relationship> getRelationshipsOfContentlet(Contentlet cont)
                                                          throws DotDataException,
                                                                 DotSecurityException
This methods gets the list of all the relationship objects associated to the structure of the contentlet as a parent or a child

Parameters:
cont - The contentlet
Returns:
A list of relationship objects
Throws:
DotSecurityException
DotDataException

getRelationshipsOfContentlet

@Deprecated
public java.util.List<Relationship> getRelationshipsOfContentlet(long contentletInode)
                                                          throws DotDataException,
                                                                 DotSecurityException
Deprecated. 

Throws:
DotDataException
DotSecurityException

getRelationshipsOfContentlet

public java.util.List<Relationship> getRelationshipsOfContentlet(java.lang.String contentletInode)
                                                          throws DotDataException,
                                                                 DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelationshipsOfContentlet

public java.util.List<Relationship> getRelationshipsOfContentlet(Contentlet cont,
                                                                 boolean hasParent)
                                                          throws DotDataException,
                                                                 DotSecurityException
This gets the list of all the relationship objects associated to the structure of the contentlet

Parameters:
cont - The contentlet
hasParent - true If you find the relations where the contentlet is parent, false If you find the relations where the contentlet is child
Returns:
A list of relationship objects
Throws:
DotSecurityException
DotDataException

getRelationshipsOfContentlet

@Deprecated
public java.util.List<Relationship> getRelationshipsOfContentlet(long contentletInode,
                                                                            boolean hasParent)
                                                          throws DotDataException,
                                                                 DotSecurityException
Deprecated. 

Throws:
DotDataException
DotSecurityException

getRelationshipsOfContentlet

public java.util.List<Relationship> getRelationshipsOfContentlet(java.lang.String contentletInode,
                                                                 boolean hasParent)
                                                          throws DotDataException,
                                                                 DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelationshipsOfStructure

@Deprecated
public java.util.List<Relationship> getRelationshipsOfStructure(Structure st,
                                                                           boolean hasParent)
Deprecated. this methods could be found on StructuresWebAPI

This gets the list of all the relationship objects associated to the structure of the contentlet

Parameters:
cont - The contentlet
hasParent - true If you find the relations where the contentlet is parent, false If you find the relations where the contentlet is child
Returns:
A list of relationship objects

getRelationshipsOfStructure

@Deprecated
public java.util.List<Relationship> getRelationshipsOfStructure(long structureInode,
                                                                           boolean hasParent)
Deprecated. 


getRelationshipsOfStructure

@Deprecated
public java.util.List<Relationship> getRelationshipsOfStructure(java.lang.String structureInode,
                                                                           boolean hasParent)
Deprecated. 


getRelatedContentlets

public static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship,
                                                               Contentlet contentlet,
                                                               boolean hasParent)
This methods retrieve the list of related contentlets in a relationship of a given contentlet

Parameters:
relationship - The relationship
cont - The contentlet
hasParent - true Find the related children contentlets where the given contentlet is the parent, false Find the related parents contentlets where the given contentlet is a child
Returns:
The list of related contentlets

getRelatedContentlets

@Deprecated
public java.util.List<Contentlet> getRelatedContentlets(long relationshipInode,
                                                                   long contentletInode,
                                                                   boolean hasParent)
                                                 throws DotDataException,
                                                        DotSecurityException
Deprecated. 

Throws:
DotDataException
DotSecurityException

getRelatedContentlets

public java.util.List<Contentlet> getRelatedContentlets(java.lang.String relationshipInode,
                                                        java.lang.String contentletInode,
                                                        boolean hasParent)
                                                 throws DotDataException,
                                                        DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelatedChildContent

public java.util.List<Contentlet> getRelatedChildContent(java.lang.String relationshipName,
                                                         java.lang.String contentletInode)
                                                  throws DotDataException,
                                                         DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelatedParentContent

public java.util.List<Contentlet> getRelatedParentContent(java.lang.String relationshipName,
                                                          java.lang.String contentletInode)
                                                   throws DotDataException,
                                                          DotSecurityException
Throws:
DotDataException
DotSecurityException

getAllRelatedContent

public java.util.List<Contentlet> getAllRelatedContent(java.lang.String relationshipName,
                                                       java.lang.String contentletInode)
                                                throws DotDataException,
                                                       DotSecurityException
Throws:
DotDataException
DotSecurityException

getRelatedContentletsByCondition

public java.util.List<Contentlet> getRelatedContentletsByCondition(java.lang.String relationshipInode,
                                                                   java.lang.String contentletInode,
                                                                   boolean hasParent,
                                                                   java.lang.String condition)
                                                            throws DotDataException,
                                                                   DotSecurityException
Throws:
DotDataException
DotSecurityException

pullRelatedContent

public java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName,
                                                     java.lang.String contentletInode,
                                                     java.lang.String limit,
                                                     java.lang.String orderBy)
                                              throws DotDataException,
                                                     DotSecurityException
This method is used by the pullRelatedContent macro to retrieve related content and display it in a page

Parameters:
relationshipName -
contentletInode -
limit -
orderBy -
Returns:
Throws:
DotSecurityException
DotDataException

pullRelatedContent

public java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName,
                                                     long contentletInode,
                                                     int limit,
                                                     java.lang.String orderBy)
Deprecated. 

This method is used by the pullRelatedContent macro to retrieve related content and display it in a page

Parameters:
relationshipName -
contentletInode -
limit -
orderBy -
Returns:
Throws:
DotSecurityException
DotDataException

pullRelatedContent

public java.util.List<Contentlet> pullRelatedContent(java.lang.String relationshipName,
                                                     java.lang.String contentletInode,
                                                     int limit,
                                                     java.lang.String orderBy)
This method is used by the pullRelatedContent macro to retrieve related content and display it in a page

Parameters:
relationshipName -
contentletInode -
limit -
orderBy -
Returns:
Throws:
DotSecurityException
DotDataException

isParentOfTheRelationship

public static boolean isParentOfTheRelationship(Contentlet contentlet,
                                                Relationship relationship)
This methods checks if the given contentlet has the role of parent of the given relationship

Parameters:
contentlet - The contentlet
relationship - The relationship
Returns:
true If the contentlet has the role of parent, false otherwise

isParentOfTheRelationship

@Deprecated
public boolean isParentOfTheRelationship(long contentletInode,
                                                    long relationshipInode)
                                  throws DotDataException,
                                         DotSecurityException
Deprecated. 

Throws:
DotDataException
DotSecurityException

isParentOfTheRelationship

public boolean isParentOfTheRelationship(java.lang.String contentletInode,
                                         java.lang.String relationshipInode)
                                  throws DotDataException,
                                         DotSecurityException
Throws:
DotDataException
DotSecurityException

isChildOfTheRelationship

public static boolean isChildOfTheRelationship(Contentlet contentlet,
                                               Relationship relationship)
This methods checks if the given contentlet has the role of child of the given relationship

Parameters:
contentlet - The contentlet
relationship - The relationship
Returns:
true If the contentlet has the role of child, false otherwise

isChildOfTheRelationship

@Deprecated
public boolean isChildOfTheRelationship(long contentletInode,
                                                   long relationshipInode)
                                 throws DotDataException,
                                        DotSecurityException
Deprecated. 

Throws:
DotDataException
DotSecurityException

isChildOfTheRelationship

public boolean isChildOfTheRelationship(java.lang.String contentletInode,
                                        java.lang.String relationshipInode)
                                 throws DotDataException,
                                        DotSecurityException
Throws:
DotDataException
DotSecurityException

pullContent

public java.util.List pullContent(java.lang.String query,
                                  java.lang.String lim,
                                  java.lang.String sortBy)
                           throws ParseException,
                                  DotSecurityException,
                                  DotDataException
Throws:
ParseException
DotSecurityException
DotDataException

pullContent

public java.util.List pullContent(java.lang.String query,
                                  java.lang.String lim,
                                  java.lang.String sortBy,
                                  java.lang.Boolean editMode)
                           throws ParseException,
                                  DotSecurityException,
                                  DotDataException
Throws:
ParseException
DotSecurityException
DotDataException

pullPersonalizedContentByCategories

public java.util.List pullPersonalizedContentByCategories(java.lang.String query,
                                                          java.lang.String lim,
                                                          java.lang.String sortBy,
                                                          java.util.List categoryList)
                                                   throws DotSecurityException,
                                                          DotDataException,
                                                          ParseException
Throws:
DotSecurityException
DotDataException
ParseException

randomizeList

public java.util.List randomizeList(java.util.List list,
                                    java.lang.String limit)

pageContent

public java.util.HashMap pageContent(java.lang.String query,
                                     java.lang.String sortBy,
                                     java.lang.String perPage,
                                     java.lang.String currentPageNumber)
This method pulls dynamic lists of content in the form of maps for the front end of the web site using pagination. This is used by the #pageContent macro.

Parameters:
query - the lucene query E.G. +text1:test text2:you
sortBy - the field used to sort you can also use the desc or asc suffix, E.G: text1 desc
perPage - the number of records showed per page, the number of contents to return
currentPageNumber - number of the page currently displayed
Returns:
HashMap, with two keys, _inodeList: the list of contents, and _total: total number of records

getEmptyMap

public java.util.Map getEmptyMap()

getEmptyList

public java.util.List getEmptyList()

isContentletIdentifierOrInode

public boolean isContentletIdentifierOrInode(java.lang.String id)
                                      throws java.lang.NumberFormatException
This method return if a identifier or inode is from a contentlet object. is use in the permalink macro

Parameters:
inode -
Returns:
boolean
Throws:
DotSecurityException
DotDataException
java.lang.NumberFormatException
Since:
1.5

getContentletByUrl

public java.lang.String getContentletByUrl(HttpServletRequest request,
                                           java.lang.String structureName,
                                           java.lang.String fieldName)
This methods matches the browsers URL to a contentlet field and returns the contentlet with the closest match. For example, let's say the user is viewing a page called /departments/accounting and there is a structure wi

Parameters:
request - The HTTPServletRequest, from velocity: $request
structureName - The name of the Structure, e.g. "Departments"
fieldName - The full name of the field, e.g. "The Department Url"
Returns:
The identifier of the top matching contentlet

doesUserHasPermission

public boolean doesUserHasPermission(long contentInode,
                                     int permission)
                              throws DotDataException
Deprecated. 

This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

doesUserHasPermission

public boolean doesUserHasPermission(java.lang.String contentInode,
                                     int permission)
                              throws DotDataException
This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

doesUserHasPermission

public boolean doesUserHasPermission(long contentInode,
                                     int permission,
                                     boolean editMode)
                              throws DotDataException
Deprecated. 

This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

doesUserHasPermission

public boolean doesUserHasPermission(java.lang.String contentInode,
                                     int permission,
                                     boolean editMode)
                              throws DotDataException
This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

doesUserHasPermission

public boolean doesUserHasPermission(long contentInode,
                                     int permission,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                              throws DotDataException
Deprecated. 

This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

doesUserHasPermission

public boolean doesUserHasPermission(java.lang.String contentInode,
                                     int permission,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                              throws DotDataException
This method checks if the logged in user (frontend) has the required permission over the passed contentlet id

Throws:
DotDataException

findFieldValues

public java.util.List<java.lang.String> findFieldValues(java.lang.String structureName,
                                                        java.lang.String fieldName,
                                                        com.liferay.portal.model.User user)
                                                 throws DotDataException
This method return the possible values in a field of all the contents of the specified structure

Parameters:
structureName - type of structure of the contentlets
fieldName - field name of the specified structure
user - User
Returns:
List list of possible values
Throws:
DotDataException


Copyright © 2010 dotCMS Inc. All Rights Reserved.