com.dotmarketing.portlets.structure.factories
Class StructureFactory

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

public class StructureFactory
extends java.lang.Object


Constructor Summary
StructureFactory()
           
 
Method Summary
static void createDefaultStructure()
          Create the default cms contentlet structure
static java.util.List<java.util.Map<java.lang.String,java.io.Serializable>> DBSearch(GenericQueryFactory.Query query, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static void deleteStructure(java.lang.String inode)
           
static void deleteStructure(Structure structure)
           
static void disableDefault()
           
static java.util.List<Structure> findStructuresUserCanUse(com.liferay.portal.model.User user, java.lang.String query, java.lang.Integer structureType, int offset, int limit)
           
static java.util.List<SimpleStructureURLMap> findStructureURLMapPatterns()
           
static java.util.List<java.lang.String> getAllStructuresNames()
          This method return the structures s
static java.util.List<java.lang.String> getAllVelocityVariablesNames()
           
static Structure getDefaultStructure()
           
static java.util.List<Field> getFilesFieldsList(Structure structure, java.util.List<java.lang.String> parametersName, java.util.List<java.lang.String[]> values)
          Get the list of file fields of a structure having a value in a list of parameters
static java.util.List<Field> getImagesFieldsList(Structure structure, java.util.List<java.lang.String> parametersName, java.util.List<java.lang.String[]> values)
          Get the list of image fields of a structure having a value in a list of parameters
static java.util.List<Structure> getNoSystemStructuresWithReadPermissions(com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static Structure getStructureByInode(java.lang.String inode)
          Deprecated. Use StructureCache.getStructureByInode instead
static Structure getStructureByType(java.lang.String type)
          Deprecated. Use StructureCache.getStructureByName instead
static Structure getStructureByVelocityVarName(java.lang.String varName)
          Gets the structure by variable name
static java.util.List<Structure> getStructures()
           
static java.util.List getStructures(int limit)
           
static java.util.List<Structure> getStructures(java.lang.String orderBy, int limit)
           
static java.util.List<Structure> getStructures(java.lang.String orderBy, int limit, java.lang.String direction)
           
static java.util.List<Structure> getStructures(java.lang.String condition, java.lang.String orderBy, int limit, int offset, java.lang.String direction)
           
static java.util.List<Structure> getStructuresByUser(com.liferay.portal.model.User user, java.lang.String condition, java.lang.String orderBy, int limit, int offset, java.lang.String direction)
           
static java.util.List<Structure> getStructuresByWFScheme(WorkflowScheme scheme, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static int getStructuresCount(java.lang.String condition)
           
static java.util.List<Structure> getStructuresUnderHost(Host h, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static java.util.List<Structure> getStructuresWithReadPermissions(com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static java.util.List<Structure> getStructuresWithWritePermissions(com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
static java.util.ArrayList<Field> getTagsFields(java.lang.String structureInode)
          Gets the list of fields of a structure which type it is TAG
static int getTotalDates(Structure structure)
           
static int getTotalFiles(Structure structure)
           
static int getTotalImages(Structure structure)
           
static int getTotals(Structure structure, java.lang.String typeField)
           
static int getTotalTextAreas(Structure structure)
           
static int getTotalWYSIWYG(Structure structure)
           
static void saveStructure(Structure structure)
           
static void saveStructure(Structure structure, java.lang.String existingId)
           
static void setPermissionAPI(PermissionAPI permissionAPIRef)
           
static void updateFolderFileAssetReferences(Structure st)
           
static void updateFolderReferences(Folder folder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureFactory

public StructureFactory()
Method Detail

setPermissionAPI

public static void setPermissionAPI(PermissionAPI permissionAPIRef)
Parameters:
permissionAPI - the permissionAPI to set

getStructureByInode

public static Structure getStructureByInode(java.lang.String inode)
Deprecated. Use StructureCache.getStructureByInode instead

Gets the structure by inode

Parameters:
inode - is the contentlet inode

getStructureByType

public static Structure getStructureByType(java.lang.String type)
Deprecated. Use StructureCache.getStructureByName instead

Gets the structure by Type

Parameters:
type - is the name of the structure

getStructureByVelocityVarName

public static Structure getStructureByVelocityVarName(java.lang.String varName)
Gets the structure by variable name

Parameters:
type - is the name of the structure

getDefaultStructure

public static Structure getDefaultStructure()

getAllStructuresNames

public static java.util.List<java.lang.String> getAllStructuresNames()
This method return the structures s

Returns:
List

getAllVelocityVariablesNames

public static java.util.List<java.lang.String> getAllVelocityVariablesNames()

findStructureURLMapPatterns

public static java.util.List<SimpleStructureURLMap> findStructureURLMapPatterns()
                                                                         throws DotDataException
Throws:
DotDataException

getStructures

public static java.util.List<Structure> getStructures()

getStructuresByUser

public static java.util.List<Structure> getStructuresByUser(com.liferay.portal.model.User user,
                                                            java.lang.String condition,
                                                            java.lang.String orderBy,
                                                            int limit,
                                                            int offset,
                                                            java.lang.String direction)

getStructuresWithWritePermissions

public static java.util.List<Structure> getStructuresWithWritePermissions(com.liferay.portal.model.User user,
                                                                          boolean respectFrontendRoles)
                                                                   throws DotDataException
Throws:
DotDataException

getStructuresWithReadPermissions

public static java.util.List<Structure> getStructuresWithReadPermissions(com.liferay.portal.model.User user,
                                                                         boolean respectFrontendRoles)
                                                                  throws DotDataException
Throws:
DotDataException

getNoSystemStructuresWithReadPermissions

public static java.util.List<Structure> getNoSystemStructuresWithReadPermissions(com.liferay.portal.model.User user,
                                                                                 boolean respectFrontendRoles)
                                                                          throws DotDataException
Throws:
DotDataException

getStructuresUnderHost

public static java.util.List<Structure> getStructuresUnderHost(Host h,
                                                               com.liferay.portal.model.User user,
                                                               boolean respectFrontendRoles)
                                                        throws DotDataException
Throws:
DotDataException

getStructuresByWFScheme

public static java.util.List<Structure> getStructuresByWFScheme(WorkflowScheme scheme,
                                                                com.liferay.portal.model.User user,
                                                                boolean respectFrontendRoles)
                                                         throws DotDataException
Throws:
DotDataException

getStructures

public static java.util.List getStructures(int limit)

getStructures

public static java.util.List<Structure> getStructures(java.lang.String orderBy,
                                                      int limit)

getStructures

public static java.util.List<Structure> getStructures(java.lang.String orderBy,
                                                      int limit,
                                                      java.lang.String direction)

getStructures

public static java.util.List<Structure> getStructures(java.lang.String condition,
                                                      java.lang.String orderBy,
                                                      int limit,
                                                      int offset,
                                                      java.lang.String direction)

saveStructure

public static void saveStructure(Structure structure)
                          throws DotHibernateException
Throws:
DotHibernateException

saveStructure

public static void saveStructure(Structure structure,
                                 java.lang.String existingId)
                          throws DotHibernateException
Throws:
DotHibernateException

deleteStructure

public static void deleteStructure(java.lang.String inode)
                            throws DotHibernateException,
                                   DotDataException
Throws:
DotHibernateException
DotDataException

deleteStructure

public static void deleteStructure(Structure structure)
                            throws DotHibernateException,
                                   DotDataException
Throws:
DotHibernateException
DotDataException

disableDefault

public static void disableDefault()
                           throws DotHibernateException
Throws:
DotHibernateException

getTotalDates

public static int getTotalDates(Structure structure)

getTotalImages

public static int getTotalImages(Structure structure)

getTotalFiles

public static int getTotalFiles(Structure structure)

getTotalTextAreas

public static int getTotalTextAreas(Structure structure)

getTotalWYSIWYG

public static int getTotalWYSIWYG(Structure structure)

getTotals

public static int getTotals(Structure structure,
                            java.lang.String typeField)

createDefaultStructure

public static void createDefaultStructure()
                                   throws DotHibernateException
Create the default cms contentlet structure

Throws:
DotHibernateException

getTagsFields

public static java.util.ArrayList<Field> getTagsFields(java.lang.String structureInode)
Gets the list of fields of a structure which type it is TAG

Parameters:
structureInode - inode of the structure owner of the fields to get
Returns:
a list of fields of a structure which type it is TAG

getStructuresCount

public static int getStructuresCount(java.lang.String condition)

getImagesFieldsList

public static java.util.List<Field> getImagesFieldsList(Structure structure,
                                                        java.util.List<java.lang.String> parametersName,
                                                        java.util.List<java.lang.String[]> values)
Get the list of image fields of a structure having a value in a list of parameters

Parameters:
structure - The structure whose fields will be compared to the list of values given
parametersName - A list with the velocity name of the fields to be compared to the structure
values - A list with the values of the fields to be compared to the structure
Returns:
List

getFilesFieldsList

public static java.util.List<Field> getFilesFieldsList(Structure structure,
                                                       java.util.List<java.lang.String> parametersName,
                                                       java.util.List<java.lang.String[]> values)
Get the list of file fields of a structure having a value in a list of parameters

Parameters:
structure - The structure whose fields will be compared to the list of values given
parametersName - A list with the velocity name of the fields to be compared to the structure
values - A list with the values of the fields to be compared to the structure
Returns:
List

DBSearch

public static java.util.List<java.util.Map<java.lang.String,java.io.Serializable>> DBSearch(GenericQueryFactory.Query query,
                                                                                            com.liferay.portal.model.User user,
                                                                                            boolean respectFrontendRoles)
                                                                                     throws ValidationException,
                                                                                            DotDataException
Throws:
ValidationException
DotDataException

updateFolderReferences

public static void updateFolderReferences(Folder folder)
                                   throws DotDataException
Throws:
DotDataException

updateFolderFileAssetReferences

public static void updateFolderFileAssetReferences(Structure st)
                                            throws DotDataException
Throws:
DotDataException

findStructuresUserCanUse

public static java.util.List<Structure> findStructuresUserCanUse(com.liferay.portal.model.User user,
                                                                 java.lang.String query,
                                                                 java.lang.Integer structureType,
                                                                 int offset,
                                                                 int limit)
                                                          throws DotDataException,
                                                                 DotSecurityException
Throws:
DotDataException
DotSecurityException


Copyright © 2013 dotCMS Inc. All Rights Reserved.