com.dotmarketing.portlets.structure.factories
Class RelationshipFactory

java.lang.Object
  extended by com.dotmarketing.portlets.structure.factories.RelationshipFactory

public class RelationshipFactory
extends java.lang.Object


Constructor Summary
RelationshipFactory()
           
 
Method Summary
static void deleteRelationship(Relationship relationship)
           
static void deleteRelationship(java.lang.String inode)
           
static void deleteRelationships(Contentlet contentlet, Relationship relationship, java.util.List<Contentlet> relatedContentlets)
          Removes the relationships from the list of related contentlets to the passed in contentlet
static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship, Contentlet contentlet)
           
static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship, Contentlet contentlet, boolean hasParent)
           
static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship, Contentlet contentlet, boolean hasParent, boolean live)
           
static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship, Contentlet contentlet, boolean hasParent, boolean live, java.lang.String orderBy)
           
static java.util.List<Relationship> getAllRelationships()
           
static java.util.List<Relationship> getAllRelationshipsByStructure(Structure st)
           
static java.util.List<Relationship> getAllRelationshipsByStructure(Structure st, boolean hasParent)
           
static java.util.List<Tree> getAllRelationshipTrees(Relationship relationship, Contentlet contentlet)
           
static java.util.List<Tree> getAllRelationshipTrees(Relationship relationship, Contentlet contentlet, boolean hasParent)
           
static int getMaxInSortOrder(java.lang.String parentInode, java.lang.String relationType)
          This method can be used to find the next in a sort order
static java.util.List<Contentlet> getRelatedContentByChild(java.lang.String childInode, java.lang.String relationType, boolean live, java.lang.String orderBy)
           
static java.util.List<Contentlet> getRelatedContentByParent(java.lang.String parentInode, java.lang.String relationType, boolean live, java.lang.String orderBy)
           
static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship, Contentlet contentlet, java.lang.String orderBy, java.lang.String sqlCondition, boolean liveContent)
          This method retrieves all the related contenlets and regardless if it has to retrieve parents, children or siblings
static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship, Contentlet contentlet, java.lang.String orderBy, java.lang.String sqlCondition, boolean liveContent, int limit)
          This method retrieves all the related contenlets and regardless if it has to retrieve parents, children or siblings
static Relationship getRelationshipByInode(java.lang.String inode)
           
static Relationship getRelationshipByRelationTypeValue(java.lang.String typeValue)
           
static java.util.List<Relationship> getRelationships(java.lang.String orderBy)
           
static java.util.List<Relationship> getRelationshipsByChild(Structure child)
           
static java.util.List<Relationship> getRelationshipsByParent(Structure parent)
           
static boolean isChildOfTheRelationship(Relationship rel, Structure st)
           
static boolean isParentOfTheRelationship(Relationship rel, Structure st)
           
static boolean isSameStructureRelationship(Relationship rel)
           
static boolean isSameStructureRelationship(Relationship rel, Structure st)
           
static void saveRelationship(Relationship relationship)
           
static void saveRelationship(Relationship relationship, java.lang.String inode)
          ISSUE 2222: https://github.com/dotCMS/dotCMS/issues/2222
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationshipFactory

public RelationshipFactory()
Method Detail

getRelationshipByInode

public static Relationship getRelationshipByInode(java.lang.String inode)

getRelationshipsByParent

public static java.util.List<Relationship> getRelationshipsByParent(Structure parent)

getRelationshipsByChild

public static java.util.List<Relationship> getRelationshipsByChild(Structure child)

getAllRelationships

public static java.util.List<Relationship> getAllRelationships()

getRelationships

public static java.util.List<Relationship> getRelationships(java.lang.String orderBy)

getRelationshipByRelationTypeValue

public static Relationship getRelationshipByRelationTypeValue(java.lang.String typeValue)

getAllRelationshipsByStructure

public static java.util.List<Relationship> getAllRelationshipsByStructure(Structure st)

getAllRelationshipsByStructure

public static java.util.List<Relationship> getAllRelationshipsByStructure(Structure st,
                                                                          boolean hasParent)

getAllRelationshipRecords

public static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship,
                                                                   Contentlet contentlet)
                                                            throws DotStateException,
                                                                   DotDataException
Throws:
DotStateException
DotDataException

getAllRelationshipRecords

public static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship,
                                                                   Contentlet contentlet,
                                                                   boolean hasParent)
                                                            throws DotStateException,
                                                                   DotDataException
Throws:
DotStateException
DotDataException

getAllRelationshipTrees

public static java.util.List<Tree> getAllRelationshipTrees(Relationship relationship,
                                                           Contentlet contentlet)
                                                    throws DotStateException,
                                                           DotDataException
Throws:
DotStateException
DotDataException

getAllRelationshipTrees

public static java.util.List<Tree> getAllRelationshipTrees(Relationship relationship,
                                                           Contentlet contentlet,
                                                           boolean hasParent)
                                                    throws DotStateException,
                                                           DotDataException
Throws:
DotStateException
DotDataException

getAllRelationshipRecords

public static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship,
                                                                   Contentlet contentlet,
                                                                   boolean hasParent,
                                                                   boolean live,
                                                                   java.lang.String orderBy)
                                                            throws DotStateException,
                                                                   DotDataException
Throws:
DotStateException
DotDataException

isParentOfTheRelationship

public static boolean isParentOfTheRelationship(Relationship rel,
                                                Structure st)

isChildOfTheRelationship

public static boolean isChildOfTheRelationship(Relationship rel,
                                               Structure st)

isSameStructureRelationship

public static boolean isSameStructureRelationship(Relationship rel,
                                                  Structure st)

isSameStructureRelationship

public static boolean isSameStructureRelationship(Relationship rel)

saveRelationship

public static void saveRelationship(Relationship relationship)
                             throws DotHibernateException
Throws:
DotHibernateException

saveRelationship

public static void saveRelationship(Relationship relationship,
                                    java.lang.String inode)
                             throws DotHibernateException
ISSUE 2222: https://github.com/dotCMS/dotCMS/issues/2222

Throws:
DotHibernateException

deleteRelationship

public static void deleteRelationship(java.lang.String inode)
                               throws DotHibernateException
Throws:
DotHibernateException

deleteRelationship

public static void deleteRelationship(Relationship relationship)
                               throws DotHibernateException
Throws:
DotHibernateException

getRelatedContentByParent

public static java.util.List<Contentlet> getRelatedContentByParent(java.lang.String parentInode,
                                                                   java.lang.String relationType,
                                                                   boolean live,
                                                                   java.lang.String orderBy)

getMaxInSortOrder

public static int getMaxInSortOrder(java.lang.String parentInode,
                                    java.lang.String relationType)
This method can be used to find the next in a sort order

Parameters:
parentInode - The parent Relationship
relationType -
Returns:
the max in the sort order

getRelatedContentByChild

public static java.util.List<Contentlet> getRelatedContentByChild(java.lang.String childInode,
                                                                  java.lang.String relationType,
                                                                  boolean live,
                                                                  java.lang.String orderBy)

getAllRelationshipRecords

public static java.util.List<Contentlet> getAllRelationshipRecords(Relationship relationship,
                                                                   Contentlet contentlet,
                                                                   boolean hasParent,
                                                                   boolean live)
                                                            throws DotStateException,
                                                                   DotDataException
Throws:
DotStateException
DotDataException

getRelatedContentlets

public static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship,
                                                               Contentlet contentlet,
                                                               java.lang.String orderBy,
                                                               java.lang.String sqlCondition,
                                                               boolean liveContent)
This method retrieves all the related contenlets and regardless if it has to retrieve parents, children or siblings

Parameters:
relationship -
contentlet -
orderBy -
Returns:

deleteRelationships

public static void deleteRelationships(Contentlet contentlet,
                                       Relationship relationship,
                                       java.util.List<Contentlet> relatedContentlets)
                                throws DotDataException
Removes the relationships from the list of related contentlets to the passed in contentlet

Parameters:
contentlet -
relationship -
relatedContentlets -
Throws:
DotDataException

getRelatedContentlets

public static java.util.List<Contentlet> getRelatedContentlets(Relationship relationship,
                                                               Contentlet contentlet,
                                                               java.lang.String orderBy,
                                                               java.lang.String sqlCondition,
                                                               boolean liveContent,
                                                               int limit)
This method retrieves all the related contenlets and regardless if it has to retrieve parents, children or siblings

Parameters:
relationship -
contentlet -
orderBy -
sqlCondition -
liveContent -
limit -
Returns:


Copyright © 2013 dotCMS Inc. All Rights Reserved.