Liferay 7.0-ce-m3

com.liferay.portlet.dynamicdatamapping.service.impl
Class DDMStructureLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureLocalServiceBaseImpl
          extended by com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl
All Implemented Interfaces:
IdentifiableBean, BaseLocalService, PersistedModelLocalService, DDMStructureLocalService

public class DDMStructureLocalServiceImpl
extends DDMStructureLocalServiceBaseImpl

Provides the local service for accessing, adding, deleting, and updating dynamic data mapping (DDM) structures.

DDM structures (structures) are used in Liferay to store structured content like document types, dynamic data definitions, or web contents.

Structures support inheritance via parent structures. They also support multi-language names and descriptions.

Structures can be related to many models in Liferay, such as those for web contents, dynamic data lists, and documents. This relationship can be established via the model's class name ID.


Field Summary
 
Fields inherited from class com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureLocalServiceBaseImpl
classNameLocalService, classNamePersistence, classNameService, counterLocalService, ddmStructureFinder, ddmStructureLinkLocalService, ddmStructureLinkPersistence, ddmStructureLocalService, ddmStructurePersistence, ddmStructureService, ddmStructureVersionLocalService, ddmStructureVersionPersistence, ddmStructureVersionService, ddmTemplateFinder, ddmTemplateLocalService, ddmTemplatePersistence, ddmTemplateService, dlFileEntryTypeFinder, dlFileEntryTypeLocalService, dlFileEntryTypePersistence, dlFileEntryTypeService, groupFinder, groupLocalService, groupPersistence, groupService, journalFolderFinder, journalFolderLocalService, journalFolderPersistence, journalFolderService, persistedModelLocalServiceRegistry, resourceLocalService, systemEventLocalService, systemEventPersistence, userFinder, userLocalService, userPersistence, userService
 
Constructor Summary
DDMStructureLocalServiceImpl()
           
 
Method Summary
 DDMStructure addStructure(long userId, long groupId, long parentStructureId, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, String storageType, int type, ServiceContext serviceContext)
           
 DDMStructure addStructure(long userId, long groupId, long parentStructureId, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String definition, String storageType, int type, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by addStructure(long, long, long, long, String, Map, Map, DDMForm, String, int, ServiceContext)
 DDMStructure addStructure(long userId, long groupId, long classNameId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, ServiceContext serviceContext)
           
 DDMStructure addStructure(long userId, long groupId, long classNameId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String definition, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by addStructure(long, long, long, Map, Map, DDMForm, ServiceContext)
 DDMStructure addStructure(long userId, long groupId, String parentStructureKey, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, String storageType, int type, ServiceContext serviceContext)
           
 DDMStructure addStructure(long userId, long groupId, String parentStructureKey, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String definition, String storageType, int type, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by addStructure(long, long, String, long, String, Map, Map, DDMForm, String, int, ServiceContext)
 void addStructureResources(DDMStructure structure, boolean addGroupPermissions, boolean addGuestPermissions)
          Adds the resources to the structure.
 void addStructureResources(DDMStructure structure, String[] groupPermissions, String[] guestPermissions)
          Adds the model resources with the permissions to the structure.
protected  DDMStructureVersion addStructureVersion(DDMStructure structure, String version)
           
 DDMStructure copyStructure(long userId, long structureId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, ServiceContext serviceContext)
          Copies a structure, creating a new structure with all the values extracted from the original one.
 DDMStructure copyStructure(long userId, long structureId, ServiceContext serviceContext)
           
 void deleteStructure(DDMStructure structure)
          Deletes the structure and its resources.
 void deleteStructure(long structureId)
          Deletes the structure and its resources.
 void deleteStructure(long groupId, long classNameId, String structureKey)
          Deletes the matching structure and its resources.
protected  Set<Long> deleteStructures(List<DDMStructure> structures)
           
 void deleteStructures(long groupId)
          Deletes all the structures of the group.
 void deleteStructures(long groupId, long classNameId)
           
protected  DDMStructure doUpdateStructure(long parentStructureId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, ServiceContext serviceContext, DDMStructure structure)
           
 DDMStructure fetchStructure(long structureId)
          Returns the structure with the ID.
 DDMStructure fetchStructure(long groupId, long classNameId, String structureKey)
          Returns the structure matching the class name ID, structure key, and group.
 DDMStructure fetchStructure(long groupId, long classNameId, String structureKey, boolean includeAncestorStructures)
          Returns the structure matching the class name ID, structure key, and group, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.
protected  void getChildrenStructureIds(List<Long> structureIds, long groupId, long parentStructureId)
           
protected  List<Long> getChildrenStructureIds(long groupId, long structureId)
           
 List<DDMStructure> getClassStructures(long classNameId)
          Deprecated. As of 6.2.0, replaced by getClassStructures(long, long)
 List<DDMStructure> getClassStructures(long classNameId, int start, int end)
          Deprecated. As of 6.2.0, replaced by getClassStructures(long, long, int, int)
 List<DDMStructure> getClassStructures(long companyId, long classNameId)
          Returns all the structures matching the class name ID.
 List<DDMStructure> getClassStructures(long companyId, long classNameId, int start, int end)
          Returns a range of all the structures matching the class name ID.
 List<DDMStructure> getClassStructures(long companyId, long classNameId, OrderByComparator<DDMStructure> orderByComparator)
          Returns all the structures matching the class name ID ordered by the comparator.
 List<DDMStructure> getClassStructures(long classNameId, OrderByComparator<DDMStructure> orderByComparator)
          Deprecated. As of 6.2.0, replaced by getClassStructures(long, long, OrderByComparator)
protected  Set<String> getDDMFormFieldsNames(DDMForm ddmForm)
           
 List<DDMStructure> getDLFileEntryTypeStructures(long dlFileEntryTypeId)
          Returns all the structures for the document library file entry type.
 List<DDMStructure> getJournalFolderStructures(long[] groupIds, long journalFolderId, int restrictionType)
           
protected  String getNextVersion(String version, boolean majorVersion)
           
protected  DDMForm getParentDDMForm(long parentStructureId)
           
 DDMStructure getStructure(long structureId)
          Returns the structure with the ID.
 DDMStructure getStructure(long groupId, long classNameId, String structureKey)
          Returns the structure matching the class name ID, structure key, and group.
 DDMStructure getStructure(long groupId, long classNameId, String structureKey, boolean includeAncestorStructures)
          Returns the structure matching the class name ID, structure key, and group, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.
 List<DDMStructure> getStructure(long groupId, String name, String description)
          Returns all the structures matching the group, name, and description.
 List<DDMStructure> getStructureEntries()
          Deprecated. As of 6.2.0, replaced by getStructures()
 List<DDMStructure> getStructureEntries(long groupId)
          Deprecated. As of 6.2.0, replaced by getStructures(long)
 List<DDMStructure> getStructureEntries(long groupId, int start, int end)
          Deprecated. As of 6.2.0, replaced by getStructures(long, int, int)
protected  String getStructureKey(String structureKey)
           
 List<DDMStructure> getStructures()
          Returns all the structures present in the system.
 List<DDMStructure> getStructures(long groupId)
          Returns all the structures present in the group.
 List<DDMStructure> getStructures(long[] groupIds)
          Returns all the structures belonging to the groups.
 List<DDMStructure> getStructures(long[] groupIds, long classNameId)
          Returns all the structures matching the class name ID and belonging to the groups.
 List<DDMStructure> getStructures(long[] groupIds, long classNameId, int start, int end)
          Returns a range of all the structures matching the class name ID and belonging to the groups.
 List<DDMStructure> getStructures(long groupId, int start, int end)
          Returns a range of all the structures belonging to the group.
 List<DDMStructure> getStructures(long groupId, long classNameId)
          Returns all the structures matching class name ID and group.
 List<DDMStructure> getStructures(long groupId, long classNameId, int start, int end)
          Returns a range of all the structures that match the class name ID and group.
 List<DDMStructure> getStructures(long groupId, long classNameId, int start, int end, OrderByComparator<DDMStructure> orderByComparator)
          Returns an ordered range of all the structures matching the class name ID and group.
 List<DDMStructure> getStructures(long groupId, String name, String description)
           
 int getStructuresCount(long groupId)
          Returns the number of structures belonging to the group.
 int getStructuresCount(long[] groupIds, long classNameId)
          Returns the number of structures matching the class name ID and belonging to the groups.
 int getStructuresCount(long groupId, long classNameId)
          Returns the number of structures matching the class name ID and group.
protected  List<DDMTemplate> getStructureTemplates(DDMStructure structure, String type)
           
 List<DDMStructure> search(long companyId, long[] groupIds, long[] classNameIds, String keywords, int start, int end, OrderByComparator<DDMStructure> orderByComparator)
          Returns an ordered range of all the structures matching the groups and class name IDs, and matching the keywords in the structure names and descriptions.
 List<DDMStructure> search(long companyId, long[] groupIds, long[] classNameIds, String name, String description, String storageType, int type, boolean andOperator, int start, int end, OrderByComparator<DDMStructure> orderByComparator)
          Returns an ordered range of all the structures matching the groups, class name IDs, name keyword, description keyword, storage type, and type.
 int searchCount(long companyId, long[] groupIds, long[] classNameIds, String keywords)
          Returns the number of structures matching the groups and class name IDs, and matching the keywords in the structure names and descriptions.
 int searchCount(long companyId, long[] groupIds, long[] classNameIds, String name, String description, String storageType, int type, boolean andOperator)
          Returns the number of structures matching the groups, class name IDs, name keyword, description keyword, storage type, and type
protected  void syncStructureTemplatesFields(DDMStructure structure)
           
 DDMStructure updateDDMForm(long structureId, DDMForm ddmForm, ServiceContext serviceContext)
           
 DDMStructure updateStructure(long groupId, long parentStructureId, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, ServiceContext serviceContext)
           
 DDMStructure updateStructure(long groupId, long parentStructureId, long classNameId, String structureKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String definition, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by updateStructure(long, long, long, String, Map, Map, DDMForm, ServiceContext)
 DDMStructure updateStructure(long structureId, long parentStructureId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, DDMForm ddmForm, ServiceContext serviceContext)
           
 DDMStructure updateStructure(long structureId, long parentStructureId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String definition, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by updateStructure(long, long, Map, Map, DDMForm, ServiceContext)
 DDMStructure updateXSD(long structureId, String definition, ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by #updateDDMForm(long, String, ServiceContext)
protected  void validate(DDMForm parentDDMForm, DDMForm ddmForm)
           
protected  void validate(long groupId, long parentStructureId, long classNameId, String structureKey, Map<Locale,String> nameMap, DDMForm ddmForm)
           
protected  void validate(Map<Locale,String> nameMap, DDMForm parentDDMForm, DDMForm ddmForm)
           
protected  void validate(Map<Locale,String> nameMap, Locale contentDefaultLocale)
           
 
Methods inherited from class com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureLocalServiceBaseImpl
addDDMStructure, addDLFileEntryTypeDDMStructure, addDLFileEntryTypeDDMStructure, addDLFileEntryTypeDDMStructures, addDLFileEntryTypeDDMStructures, addJournalFolderDDMStructure, addJournalFolderDDMStructure, addJournalFolderDDMStructures, addJournalFolderDDMStructures, afterPropertiesSet, clearDLFileEntryTypeDDMStructures, clearJournalFolderDDMStructures, createDDMStructure, deleteDDMStructure, deleteDDMStructure, deleteDLFileEntryTypeDDMStructure, deleteDLFileEntryTypeDDMStructure, deleteDLFileEntryTypeDDMStructures, deleteDLFileEntryTypeDDMStructures, deleteJournalFolderDDMStructure, deleteJournalFolderDDMStructure, deleteJournalFolderDDMStructures, deleteJournalFolderDDMStructures, deletePersistedModel, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchDDMStructure, fetchDDMStructureByUuidAndGroupId, getActionableDynamicQuery, getBeanIdentifier, getClassNameLocalService, getClassNamePersistence, getClassNameService, getCounterLocalService, getDDMStructure, getDDMStructureByUuidAndGroupId, getDDMStructureFinder, getDDMStructureLinkLocalService, getDDMStructureLinkPersistence, getDDMStructureLocalService, getDDMStructurePersistence, getDDMStructures, getDDMStructuresByUuidAndCompanyId, getDDMStructuresByUuidAndCompanyId, getDDMStructuresCount, getDDMStructureService, getDDMStructureVersionLocalService, getDDMStructureVersionPersistence, getDDMStructureVersionService, getDDMTemplateFinder, getDDMTemplateLocalService, getDDMTemplatePersistence, getDDMTemplateService, getDLFileEntryTypeDDMStructures, getDLFileEntryTypeDDMStructures, getDLFileEntryTypeDDMStructures, getDLFileEntryTypeDDMStructuresCount, getDLFileEntryTypeFinder, getDLFileEntryTypeLocalService, getDLFileEntryTypePersistence, getDLFileEntryTypePrimaryKeys, getDLFileEntryTypeService, getExportActionableDynamicQuery, getGroupFinder, getGroupLocalService, getGroupPersistence, getGroupService, getJournalFolderDDMStructures, getJournalFolderDDMStructures, getJournalFolderDDMStructures, getJournalFolderDDMStructuresCount, getJournalFolderFinder, getJournalFolderLocalService, getJournalFolderPersistence, getJournalFolderPrimaryKeys, getJournalFolderService, getModelClass, getModelClassName, getPersistedModel, getResourceLocalService, getSystemEventLocalService, getSystemEventPersistence, getUserFinder, getUserLocalService, getUserPersistence, getUserService, hasDLFileEntryTypeDDMStructure, hasDLFileEntryTypeDDMStructures, hasJournalFolderDDMStructure, hasJournalFolderDDMStructures, initActionableDynamicQuery, runSQL, setBeanIdentifier, setClassNameLocalService, setClassNamePersistence, setClassNameService, setCounterLocalService, setDDMStructureFinder, setDDMStructureLinkLocalService, setDDMStructureLinkPersistence, setDDMStructureLocalService, setDDMStructurePersistence, setDDMStructureService, setDDMStructureVersionLocalService, setDDMStructureVersionPersistence, setDDMStructureVersionService, setDDMTemplateFinder, setDDMTemplateLocalService, setDDMTemplatePersistence, setDDMTemplateService, setDLFileEntryTypeDDMStructures, setDLFileEntryTypeFinder, setDLFileEntryTypeLocalService, setDLFileEntryTypePersistence, setDLFileEntryTypeService, setGroupFinder, setGroupLocalService, setGroupPersistence, setGroupService, setJournalFolderDDMStructures, setJournalFolderFinder, setJournalFolderLocalService, setJournalFolderPersistence, setJournalFolderService, setResourceLocalService, setSystemEventLocalService, setSystemEventPersistence, setUserFinder, setUserLocalService, setUserPersistence, setUserService, updateDDMStructure
 
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl
getClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDMStructureLocalServiceImpl

public DDMStructureLocalServiceImpl()
Method Detail

addStructure

public DDMStructure addStructure(long userId,
                                 long groupId,
                                 long parentStructureId,
                                 long classNameId,
                                 String structureKey,
                                 Map<Locale,String> nameMap,
                                 Map<Locale,String> descriptionMap,
                                 DDMForm ddmForm,
                                 String storageType,
                                 int type,
                                 ServiceContext serviceContext)
                          throws PortalException
Throws:
PortalException

addStructure

@Deprecated
public DDMStructure addStructure(long userId,
                                            long groupId,
                                            long parentStructureId,
                                            long classNameId,
                                            String structureKey,
                                            Map<Locale,String> nameMap,
                                            Map<Locale,String> descriptionMap,
                                            String definition,
                                            String storageType,
                                            int type,
                                            ServiceContext serviceContext)
                          throws PortalException
Deprecated. As of 7.0.0, replaced by addStructure(long, long, long, long, String, Map, Map, DDMForm, String, int, ServiceContext)

Adds a structure referencing its parent structure.

Parameters:
userId - the primary key of the structure's creator/owner
groupId - the primary key of the group
parentStructureId - the primary key of the parent structure (optionally DDMStructureConstants.DEFAULT_PARENT_STRUCTURE_ID)
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure (optionally null)
nameMap - the structure's locales and localized names
descriptionMap - the structure's locales and localized descriptions
definition - the structure's XML schema definition
storageType - the structure's storage type. It can be "xml" or "expando". For more information, see StorageType.
type - the structure's type. For more information, see DDMStructureConstants.
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the structure.
Returns:
the structure
Throws:
PortalException - if a user with the primary key could not be found, if the XSD was not well-formed, or if a portal exception occurred

addStructure

public DDMStructure addStructure(long userId,
                                 long groupId,
                                 long classNameId,
                                 Map<Locale,String> nameMap,
                                 Map<Locale,String> descriptionMap,
                                 DDMForm ddmForm,
                                 ServiceContext serviceContext)
                          throws PortalException
Throws:
PortalException

addStructure

@Deprecated
public DDMStructure addStructure(long userId,
                                            long groupId,
                                            long classNameId,
                                            Map<Locale,String> nameMap,
                                            Map<Locale,String> descriptionMap,
                                            String definition,
                                            ServiceContext serviceContext)
                          throws PortalException
Deprecated. As of 7.0.0, replaced by addStructure(long, long, long, Map, Map, DDMForm, ServiceContext)

Adds a structure referencing a default parent structure, using the portal property dynamic.data.lists.storage.type storage type and default structure type.

Parameters:
userId - the primary key of the structure's creator/owner
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
nameMap - the structure's locales and localized names
descriptionMap - the structure's locales and localized descriptions
definition - the structure's XML schema definition
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the structure.
Returns:
the structure
Throws:
PortalException - if a user with the primary key could not be found, if the XSD was not well-formed, or if a portal exception occurred

addStructure

public DDMStructure addStructure(long userId,
                                 long groupId,
                                 String parentStructureKey,
                                 long classNameId,
                                 String structureKey,
                                 Map<Locale,String> nameMap,
                                 Map<Locale,String> descriptionMap,
                                 DDMForm ddmForm,
                                 String storageType,
                                 int type,
                                 ServiceContext serviceContext)
                          throws PortalException
Throws:
PortalException

addStructure

@Deprecated
public DDMStructure addStructure(long userId,
                                            long groupId,
                                            String parentStructureKey,
                                            long classNameId,
                                            String structureKey,
                                            Map<Locale,String> nameMap,
                                            Map<Locale,String> descriptionMap,
                                            String definition,
                                            String storageType,
                                            int type,
                                            ServiceContext serviceContext)
                          throws PortalException
Deprecated. As of 7.0.0, replaced by addStructure(long, long, String, long, String, Map, Map, DDMForm, String, int, ServiceContext)

Adds a structure referencing a default parent structure if the parent structure is not found.

Parameters:
userId - the primary key of the structure's creator/owner
groupId - the primary key of the group
parentStructureKey - the unique string identifying the parent structure (optionally null)
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure (optionally null)
nameMap - the structure's locales and localized names
descriptionMap - the structure's locales and localized descriptions
definition - the structure's XML schema definition
storageType - the structure's storage type. It can be "xml" or "expando". For more information, see StorageType.
type - the structure's type. For more information, see DDMStructureConstants.
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions and group permissions for the structure.
Returns:
the structure
Throws:
PortalException - if a user with the primary key could not be found, if the XSD was not well-formed, or if a portal exception occurred

addStructureResources

public void addStructureResources(DDMStructure structure,
                                  boolean addGroupPermissions,
                                  boolean addGuestPermissions)
                           throws PortalException
Adds the resources to the structure.

Parameters:
structure - the structure to add resources to
addGroupPermissions - whether to add group permissions
addGuestPermissions - whether to add guest permissions
Throws:
PortalException - if a portal exception occurred

addStructureResources

public void addStructureResources(DDMStructure structure,
                                  String[] groupPermissions,
                                  String[] guestPermissions)
                           throws PortalException
Adds the model resources with the permissions to the structure.

Parameters:
structure - the structure to add resources to
groupPermissions - the group permissions to be added
guestPermissions - the guest permissions to be added
Throws:
PortalException - if a portal exception occurred

copyStructure

public DDMStructure copyStructure(long userId,
                                  long structureId,
                                  Map<Locale,String> nameMap,
                                  Map<Locale,String> descriptionMap,
                                  ServiceContext serviceContext)
                           throws PortalException
Copies a structure, creating a new structure with all the values extracted from the original one. The new structure supports a new name and description.

Parameters:
userId - the primary key of the structure's creator/owner
structureId - the primary key of the structure to be copied
nameMap - the new structure's locales and localized names
descriptionMap - the new structure's locales and localized descriptions
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the structure.
Returns:
the new structure
Throws:
PortalException - if a portal exception occurred

copyStructure

public DDMStructure copyStructure(long userId,
                                  long structureId,
                                  ServiceContext serviceContext)
                           throws PortalException
Throws:
PortalException

deleteStructure

@SystemEvent(type=1)
public void deleteStructure(DDMStructure structure)
                     throws PortalException
Deletes the structure and its resources.

Before deleting the structure, this method verifies whether the structure is required by another entity. If it is needed, an exception is thrown.

Parameters:
structure - the structure to be deleted
Throws:
PortalException - if a portal exception occurred

deleteStructure

public void deleteStructure(long structureId)
                     throws PortalException
Deletes the structure and its resources.

Before deleting the structure, the system verifies whether the structure is required by another entity. If it is needed, an exception is thrown.

Parameters:
structureId - the primary key of the structure to be deleted
Throws:
PortalException - if a portal exception occurred

deleteStructure

public void deleteStructure(long groupId,
                            long classNameId,
                            String structureKey)
                     throws PortalException
Deletes the matching structure and its resources.

Before deleting the structure, the system verifies whether the structure is required by another entity. If it is needed, an exception is thrown.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
Throws:
PortalException - if a portal exception occurred

deleteStructures

public void deleteStructures(long groupId)
                      throws PortalException
Deletes all the structures of the group.

Before deleting the structures, the system verifies whether each structure is required by another entity. If any of the structures are needed, an exception is thrown.

Parameters:
groupId - the primary key of the group
Throws:
PortalException - if a portal exception occurred

deleteStructures

public void deleteStructures(long groupId,
                             long classNameId)
                      throws PortalException
Throws:
PortalException

fetchStructure

public DDMStructure fetchStructure(long structureId)
Returns the structure with the ID.

Parameters:
structureId - the primary key of the structure
Returns:
the structure with the structure ID, or null if a matching structure could not be found

fetchStructure

public DDMStructure fetchStructure(long groupId,
                                   long classNameId,
                                   String structureKey)
Returns the structure matching the class name ID, structure key, and group.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
Returns:
the matching structure, or null if a matching structure could not be found

fetchStructure

public DDMStructure fetchStructure(long groupId,
                                   long classNameId,
                                   String structureKey,
                                   boolean includeAncestorStructures)
                            throws PortalException
Returns the structure matching the class name ID, structure key, and group, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.

This method first searches in the group. If the structure is still not found and includeAncestorStructures is set to true, this method searches the group's ancestor sites (that have sharing enabled) and lastly searches global scoped sites.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
includeAncestorStructures - whether to include ancestor sites (that have sharing enabled) and include global scoped sites in the search
Returns:
the matching structure, or null if a matching structure could not be found
Throws:
PortalException - if a portal exception occurred

getClassStructures

@Deprecated
public List<DDMStructure> getClassStructures(long classNameId)
Deprecated. As of 6.2.0, replaced by getClassStructures(long, long)


getClassStructures

@Deprecated
public List<DDMStructure> getClassStructures(long classNameId,
                                                        int start,
                                                        int end)
Deprecated. As of 6.2.0, replaced by getClassStructures(long, long, int, int)


getClassStructures

public List<DDMStructure> getClassStructures(long companyId,
                                             long classNameId)
Returns all the structures matching the class name ID.

Parameters:
companyId - the primary key of the structure's company
classNameId - the primary key of the class name for the structure's related model
Returns:
the structures matching the class name ID

getClassStructures

public List<DDMStructure> getClassStructures(long companyId,
                                             long classNameId,
                                             int start,
                                             int end)
Returns a range of all the structures matching the class name ID.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the structure's company
classNameId - the primary key of the class name for the structure's related model
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
Returns:
the range of matching structures

getClassStructures

public List<DDMStructure> getClassStructures(long companyId,
                                             long classNameId,
                                             OrderByComparator<DDMStructure> orderByComparator)
Returns all the structures matching the class name ID ordered by the comparator.

Parameters:
companyId - the primary key of the structure's company
classNameId - the primary key of the class name for the structure's related model
orderByComparator - the comparator to order the structures (optionally null)
Returns:
the matching structures ordered by the comparator

getClassStructures

@Deprecated
public List<DDMStructure> getClassStructures(long classNameId,
                                                        OrderByComparator<DDMStructure> orderByComparator)
Deprecated. As of 6.2.0, replaced by getClassStructures(long, long, OrderByComparator)


getDLFileEntryTypeStructures

public List<DDMStructure> getDLFileEntryTypeStructures(long dlFileEntryTypeId)
Returns all the structures for the document library file entry type.

Parameters:
dlFileEntryTypeId - the primary key of the document library file entry type
Returns:
the structures for the document library file entry type

getJournalFolderStructures

public List<DDMStructure> getJournalFolderStructures(long[] groupIds,
                                                     long journalFolderId,
                                                     int restrictionType)
                                              throws PortalException
Throws:
PortalException

getStructure

public DDMStructure getStructure(long structureId)
                          throws PortalException
Returns the structure with the ID.

Parameters:
structureId - the primary key of the structure
Returns:
the structure with the ID
Throws:
PortalException - if a structure with the ID could not be found

getStructure

public DDMStructure getStructure(long groupId,
                                 long classNameId,
                                 String structureKey)
                          throws PortalException
Returns the structure matching the class name ID, structure key, and group.

Parameters:
groupId - the primary key of the structure's group
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
Returns:
the matching structure
Throws:
PortalException - if a matching structure could not be found

getStructure

public DDMStructure getStructure(long groupId,
                                 long classNameId,
                                 String structureKey,
                                 boolean includeAncestorStructures)
                          throws PortalException
Returns the structure matching the class name ID, structure key, and group, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.

This method first searches in the group. If the structure is still not found and includeAncestorStructures is set to true, this method searches the group's ancestor sites (that have sharing enabled) and lastly searches global scoped sites.

Parameters:
groupId - the primary key of the structure's group
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
includeAncestorStructures - whether to include ancestor sites (that have sharing enabled) and include global scoped sites in the search in the search
Returns:
the matching structure
Throws:
PortalException - if a matching structure could not be found

getStructure

public List<DDMStructure> getStructure(long groupId,
                                       String name,
                                       String description)
Returns all the structures matching the group, name, and description.

Parameters:
groupId - the primary key of the structure's group
name - the structure's name
description - the structure's description
Returns:
the matching structures

getStructureEntries

@Deprecated
public List<DDMStructure> getStructureEntries()
Deprecated. As of 6.2.0, replaced by getStructures()


getStructureEntries

@Deprecated
public List<DDMStructure> getStructureEntries(long groupId)
Deprecated. As of 6.2.0, replaced by getStructures(long)


getStructureEntries

@Deprecated
public List<DDMStructure> getStructureEntries(long groupId,
                                                         int start,
                                                         int end)
Deprecated. As of 6.2.0, replaced by getStructures(long, int, int)


getStructures

public List<DDMStructure> getStructures()
Returns all the structures present in the system.

Returns:
the structures present in the system

getStructures

public List<DDMStructure> getStructures(long groupId)
Returns all the structures present in the group.

Parameters:
groupId - the primary key of the group
Returns:
the structures present in the group

getStructures

public List<DDMStructure> getStructures(long groupId,
                                        int start,
                                        int end)
Returns a range of all the structures belonging to the group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
groupId - the primary key of the group
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
Returns:
the range of matching structures

getStructures

public List<DDMStructure> getStructures(long groupId,
                                        long classNameId)
Returns all the structures matching class name ID and group.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
Returns:
the matching structures

getStructures

public List<DDMStructure> getStructures(long groupId,
                                        long classNameId,
                                        int start,
                                        int end)
Returns a range of all the structures that match the class name ID and group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
Returns:
the range of matching structures

getStructures

public List<DDMStructure> getStructures(long groupId,
                                        long classNameId,
                                        int start,
                                        int end,
                                        OrderByComparator<DDMStructure> orderByComparator)
Returns an ordered range of all the structures matching the class name ID and group.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
orderByComparator - the comparator to order the structures (optionally null)
Returns:
the range of matching structures ordered by the comparator

getStructures

public List<DDMStructure> getStructures(long groupId,
                                        String name,
                                        String description)

getStructures

public List<DDMStructure> getStructures(long[] groupIds)
Returns all the structures belonging to the groups.

Parameters:
groupIds - the primary keys of the groups
Returns:
the structures belonging to the groups

getStructures

public List<DDMStructure> getStructures(long[] groupIds,
                                        long classNameId)
Returns all the structures matching the class name ID and belonging to the groups.

Parameters:
groupIds - the primary keys of the groups
classNameId - the primary key of the class name for the structure's related model
Returns:
the matching structures

getStructures

public List<DDMStructure> getStructures(long[] groupIds,
                                        long classNameId,
                                        int start,
                                        int end)
Returns a range of all the structures matching the class name ID and belonging to the groups.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
groupIds - the primary keys of the groups
classNameId - the primary key of the class name for the structure's related model
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
Returns:
the range of matching structures

getStructuresCount

public int getStructuresCount(long groupId)
Returns the number of structures belonging to the group.

Parameters:
groupId - the primary key of the group
Returns:
the number of structures belonging to the group

getStructuresCount

public int getStructuresCount(long groupId,
                              long classNameId)
Returns the number of structures matching the class name ID and group.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the structure's related model
Returns:
the number of matching structures

getStructuresCount

public int getStructuresCount(long[] groupIds,
                              long classNameId)
Returns the number of structures matching the class name ID and belonging to the groups.

Parameters:
groupIds - the primary keys of the groups
classNameId - the primary key of the class name for the structure's related model
Returns:
the number of matching structures

search

public List<DDMStructure> search(long companyId,
                                 long[] groupIds,
                                 long[] classNameIds,
                                 String keywords,
                                 int start,
                                 int end,
                                 OrderByComparator<DDMStructure> orderByComparator)
Returns an ordered range of all the structures matching the groups and class name IDs, and matching the keywords in the structure names and descriptions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the structure's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the class names of the models the structures are related to
keywords - the keywords (space separated), which may occur in the structure's name or description (optionally null)
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
orderByComparator - the comparator to order the structures (optionally null)
Returns:
the range of matching structures ordered by the comparator

search

public List<DDMStructure> search(long companyId,
                                 long[] groupIds,
                                 long[] classNameIds,
                                 String name,
                                 String description,
                                 String storageType,
                                 int type,
                                 boolean andOperator,
                                 int start,
                                 int end,
                                 OrderByComparator<DDMStructure> orderByComparator)
Returns an ordered range of all the structures matching the groups, class name IDs, name keyword, description keyword, storage type, and type.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the structure's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the class names of the models the structures are related to
name - the name keywords
description - the description keywords
storageType - the structure's storage type. It can be "xml" or "expando". For more information, see StorageType.
type - the structure's type. For more information, see DDMStructureConstants.
andOperator - whether every field must match its keywords, or just one field
start - the lower bound of the range of structures to return
end - the upper bound of the range of structures to return (not inclusive)
orderByComparator - the comparator to order the structures (optionally null)
Returns:
the range of matching structures ordered by the comparator

searchCount

public int searchCount(long companyId,
                       long[] groupIds,
                       long[] classNameIds,
                       String keywords)
Returns the number of structures matching the groups and class name IDs, and matching the keywords in the structure names and descriptions.

Parameters:
companyId - the primary key of the structure's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the class names of the models the structures are related to
keywords - the keywords (space separated), which may occur in the structure's name or description (optionally null)
Returns:
the number of matching structures

searchCount

public int searchCount(long companyId,
                       long[] groupIds,
                       long[] classNameIds,
                       String name,
                       String description,
                       String storageType,
                       int type,
                       boolean andOperator)
Returns the number of structures matching the groups, class name IDs, name keyword, description keyword, storage type, and type

Parameters:
companyId - the primary key of the structure's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the class names of the models the structure's are related to
name - the name keywords
description - the description keywords
storageType - the structure's storage type. It can be "xml" or "expando". For more information, see StorageType.
type - the structure's type. For more information, see DDMStructureConstants.
andOperator - whether every field must match its keywords, or just one field
Returns:
the number of matching structures

updateDDMForm

public DDMStructure updateDDMForm(long structureId,
                                  DDMForm ddmForm,
                                  ServiceContext serviceContext)
                           throws PortalException
Throws:
PortalException

updateStructure

public DDMStructure updateStructure(long groupId,
                                    long parentStructureId,
                                    long classNameId,
                                    String structureKey,
                                    Map<Locale,String> nameMap,
                                    Map<Locale,String> descriptionMap,
                                    DDMForm ddmForm,
                                    ServiceContext serviceContext)
                             throws PortalException
Throws:
PortalException

updateStructure

@Deprecated
public DDMStructure updateStructure(long groupId,
                                               long parentStructureId,
                                               long classNameId,
                                               String structureKey,
                                               Map<Locale,String> nameMap,
                                               Map<Locale,String> descriptionMap,
                                               String definition,
                                               ServiceContext serviceContext)
                             throws PortalException
Deprecated. As of 7.0.0, replaced by updateStructure(long, long, long, String, Map, Map, DDMForm, ServiceContext)

Updates the structure matching the class name ID, structure key, and group, replacing its old parent structure, name map, description map, and XSD with new ones.

Parameters:
groupId - the primary key of the group
parentStructureId - the primary key of the new parent structure
classNameId - the primary key of the class name for the structure's related model
structureKey - the unique string identifying the structure
nameMap - the structure's new locales and localized names
descriptionMap - the structure's new locales and localized description
definition - the structure's new XML schema definition
serviceContext - the service context to be applied. Can set the structure's modification date.
Returns:
the updated structure
Throws:
PortalException - if a matching structure could not be found, if the XSD was not well-formed, or if a portal exception occurred

updateStructure

public DDMStructure updateStructure(long structureId,
                                    long parentStructureId,
                                    Map<Locale,String> nameMap,
                                    Map<Locale,String> descriptionMap,
                                    DDMForm ddmForm,
                                    ServiceContext serviceContext)
                             throws PortalException
Throws:
PortalException

updateStructure

@Deprecated
public DDMStructure updateStructure(long structureId,
                                               long parentStructureId,
                                               Map<Locale,String> nameMap,
                                               Map<Locale,String> descriptionMap,
                                               String definition,
                                               ServiceContext serviceContext)
                             throws PortalException
Deprecated. As of 7.0.0, replaced by updateStructure(long, long, Map, Map, DDMForm, ServiceContext)

Updates the structure matching the structure ID, replacing its old parent structure, name map, description map, and XSD with new ones.

Parameters:
structureId - the primary key of the structure
parentStructureId - the primary key of the new parent structure
nameMap - the structure's new locales and localized names
descriptionMap - the structure's new locales and localized descriptions
definition - the structure's new XML schema definition
serviceContext - the service context to be applied. Can set the structure's modification date.
Returns:
the updated structure
Throws:
PortalException - if a matching structure could not be found, if the XSD was not well-formed, or if a portal exception occurred

updateXSD

@Deprecated
public DDMStructure updateXSD(long structureId,
                                         String definition,
                                         ServiceContext serviceContext)
                       throws PortalException
Deprecated. As of 7.0.0, replaced by #updateDDMForm(long, String, ServiceContext)

Updates the structure matching the structure ID, replacing its XSD with a new one.

Parameters:
structureId - the primary key of the structure
definition - the structure's new XML schema definition
serviceContext - the service context to be applied. Can set the structure's modification date.
Returns:
the updated structure
Throws:
PortalException - if a matching structure could not be found, if the XSD was not well-formed, or if a portal exception occurred

addStructureVersion

protected DDMStructureVersion addStructureVersion(DDMStructure structure,
                                                  String version)

deleteStructures

protected Set<Long> deleteStructures(List<DDMStructure> structures)
                              throws PortalException
Throws:
PortalException

doUpdateStructure

protected DDMStructure doUpdateStructure(long parentStructureId,
                                         Map<Locale,String> nameMap,
                                         Map<Locale,String> descriptionMap,
                                         DDMForm ddmForm,
                                         ServiceContext serviceContext,
                                         DDMStructure structure)
                                  throws PortalException
Throws:
PortalException

getChildrenStructureIds

protected void getChildrenStructureIds(List<Long> structureIds,
                                       long groupId,
                                       long parentStructureId)
                                throws PortalException
Throws:
PortalException

getChildrenStructureIds

protected List<Long> getChildrenStructureIds(long groupId,
                                             long structureId)
                                      throws PortalException
Throws:
PortalException

getDDMFormFieldsNames

protected Set<String> getDDMFormFieldsNames(DDMForm ddmForm)

getNextVersion

protected String getNextVersion(String version,
                                boolean majorVersion)

getParentDDMForm

protected DDMForm getParentDDMForm(long parentStructureId)

getStructureKey

protected String getStructureKey(String structureKey)

getStructureTemplates

protected List<DDMTemplate> getStructureTemplates(DDMStructure structure,
                                                  String type)

syncStructureTemplatesFields

protected void syncStructureTemplatesFields(DDMStructure structure)

validate

protected void validate(DDMForm parentDDMForm,
                        DDMForm ddmForm)
                 throws PortalException
Throws:
PortalException

validate

protected void validate(long groupId,
                        long parentStructureId,
                        long classNameId,
                        String structureKey,
                        Map<Locale,String> nameMap,
                        DDMForm ddmForm)
                 throws PortalException
Throws:
PortalException

validate

protected void validate(Map<Locale,String> nameMap,
                        DDMForm parentDDMForm,
                        DDMForm ddmForm)
                 throws PortalException
Throws:
PortalException

validate

protected void validate(Map<Locale,String> nameMap,
                        Locale contentDefaultLocale)
                 throws PortalException
Throws:
PortalException

Liferay 7.0-ce-m3