Class LayoutServiceImpl

Object
com.liferay.portal.kernel.service.BaseServiceImpl
com.liferay.portal.service.base.LayoutServiceBaseImpl
com.liferay.portal.service.impl.LayoutServiceImpl
All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService, com.liferay.portal.kernel.service.BaseService, com.liferay.portal.kernel.service.LayoutService

public class LayoutServiceImpl extends LayoutServiceBaseImpl
Provides the remote service for accessing, adding, deleting, exporting, importing, scheduling publishing of, and updating layouts. Its methods include permission checks.
Author:
Brian Wing Shun Chan, Wesley Gong, Tibor Lipusz
  • Field Summary

    Fields inherited from class com.liferay.portal.service.base.LayoutServiceBaseImpl

    counterLocalService, layoutFinder, layoutLocalService, layoutPersistence, layoutService

    Fields inherited from class com.liferay.portal.kernel.service.BaseServiceImpl

    ANONYMOUS_NAMES, JRUN_ANONYMOUS, ORACLE_ANONYMOUS, SUN_ANONYMOUS, WEBLOGIC_ANONYMOUS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.liferay.portal.kernel.model.Layout
    addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, long classNameId, long classPK, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale,String> friendlyURLMap, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a layout with additional parameters.
    com.liferay.portal.kernel.model.Layout
    addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, String friendlyURL, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a layout with single entry maps for name, title, and description to the default locale.
    com.liferay.portal.kernel.model.Layout
    addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale,String> friendlyURLMap, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a layout with additional parameters.
    com.liferay.portal.kernel.model.Layout
    addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale,String> friendlyURLMap, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Adds a layout with additional parameters.
    com.liferay.portal.kernel.repository.model.FileEntry
    addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream, String mimeType)
     
    protected void
    checkLayoutTypeSettings(com.liferay.portal.kernel.model.Layout layout, String originalTypeSettings, String newTypeSettings)
     
    com.liferay.portal.kernel.model.Layout
    copyLayout(long groupId, boolean privateLayout, Map<Locale,String> localeNamesMap, boolean hidden, boolean system, boolean copyPermissions, long sourcePlid, com.liferay.portal.kernel.service.ServiceContext serviceContext)
     
    void
    deleteLayout(long groupId, boolean privateLayout, long layoutId, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Deletes the layout with the primary key, also deleting the layout's child layouts, and associated resources.
    void
    deleteLayout(long plid, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Deletes the layout with the plid, also deleting the layout's child layouts, and associated resources.
    void
    deleteLayout(String externalReferenceCode, long groupId)
     
    void
    deleteTempFileEntry(long groupId, String folderName, String fileName)
     
    com.liferay.portal.kernel.model.Layout
    fetchFirstLayout(long groupId, boolean privateLayout, boolean published)
     
    com.liferay.portal.kernel.model.Layout
    fetchLayout(long groupId, boolean privateLayout, long layoutId)
     
    com.liferay.portal.kernel.model.Layout
    fetchLayoutByExternalReferenceCode(String externalReferenceCode, long groupId)
     
    long
    fetchLayoutPlid(String uuid, long groupId, boolean privateLayout)
     
    protected List<com.liferay.portal.kernel.model.Layout>
    filterLayouts(List<com.liferay.portal.kernel.model.Layout> layouts)
     
    protected List<com.liferay.portal.kernel.model.Layout>
    filterLayouts(List<com.liferay.portal.kernel.model.Layout> layouts, int start, int end)
     
    List<com.liferay.portal.kernel.model.Layout>
    getAncestorLayouts(long plid)
    Returns all the ancestor layouts of the layout.
    long
    Returns the control panel layout's plid.
    long
    getDefaultPlid(long groupId, boolean privateLayout)
    Returns primary key of the matching default layout for the group.
    long
    getDefaultPlid(long groupId, long scopeGroupId, boolean privateLayout, String portletId)
    Returns the primary key of the default layout for the group.
    long
    getDefaultPlid(long groupId, long scopeGroupId, String portletId)
     
    com.liferay.portal.kernel.model.Layout
    getLayoutByExternalReferenceCode(String externalReferenceCode, long groupId)
     
    com.liferay.portal.kernel.model.Layout
    getLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout)
    Returns the layout matching the UUID, group, and privacy.
    getLayoutName(long groupId, boolean privateLayout, long layoutId, String languageId)
    Returns the name of the layout.
    long
    getLayoutPlid(String uuid, long groupId, boolean privateLayout)
    Returns the layout's plid that matches the parameters.
    com.liferay.portal.kernel.model.LayoutReference[]
    getLayoutReferences(long companyId, String portletId, String preferencesKey, String preferencesValue)
    Returns the layout references for all the layouts that belong to the company and belong to the portlet that matches the preferences.
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, long parentLayoutId)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, long parentLayoutId, int start, int end)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, String type)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, String type, int start, int end)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int[] statuses, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Layout> orderByComparator)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Layout> orderByComparator)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, String type)
     
    List<com.liferay.portal.kernel.model.Layout>
    getLayouts(long groupId, String type, int start, int end)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout, long parentLayoutId)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout, long parentLayoutId, int priority)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout, String type)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout, String keywords, String[] types)
     
    int
    getLayoutsCount(long groupId, boolean privateLayout, String keywords, String[] types, int[] statuses)
     
    int
    getLayoutsCount(long groupId, String type)
     
    protected List<String>
    getPortletIds(com.liferay.portal.kernel.model.Layout layout, String typeSettings)
     
    getTempFileNames(long groupId, String folderName)
     
    boolean
    hasLayout(String uuid, long groupId, boolean privateLayout)
    Returns true if there is a matching layout with the UUID, group, and privacy.
    boolean
    hasPortletId(long plid, String portletId)
     
    com.liferay.portal.kernel.model.Layout
    publishLayout(long plid)
     
    void
    schedulePublishToLive(long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, Map<String,String[]> parameterMap, String groupName, String cronText, Date schedulerStartDate, Date schedulerEndDate, String description)
    Schedules a range of layouts to be published.
    void
    schedulePublishToRemote(long sourceGroupId, boolean privateLayout, Map<Long,Boolean> layoutIdMap, Map<String,String[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout, Date startDate, Date endDate, String groupName, String cronText, Date schedulerStartDate, Date schedulerEndDate, String description)
    Schedules a range of layouts to be stored.
    void
    setLayouts(long groupId, boolean privateLayout, long parentLayoutId, long[] layoutIds, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Sets the layouts for the group, replacing and prioritizing all layouts of the parent layout.
    void
    unschedulePublishToLive(long groupId, String jobName, String groupName)
    Deletes the job from the scheduler's queue.
    void
    unschedulePublishToRemote(long groupId, String jobName, String groupName)
    Deletes the job from the scheduler's persistent queue.
    com.liferay.portal.kernel.model.Layout
    updateIconImage(long plid, byte[] bytes)
     
    com.liferay.portal.kernel.model.Layout
    updateLayout(long groupId, boolean privateLayout, long layoutId, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, boolean hidden, Map<Locale,String> friendlyURLMap, boolean hasIconImage, byte[] iconBytes, long styleBookEntryId, long faviconFileEntryId, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the layout with additional parameters.
    com.liferay.portal.kernel.model.Layout
    updateLayout(long groupId, boolean privateLayout, long layoutId, String typeSettings)
    Updates the layout replacing its type settings.
    com.liferay.portal.kernel.model.Layout
    updateLookAndFeel(long groupId, boolean privateLayout, long layoutId, String themeId, String colorSchemeId, String css)
    Updates the look and feel of the layout.
    com.liferay.portal.kernel.model.Layout
    updateName(long groupId, boolean privateLayout, long layoutId, String name, String languageId)
    Updates the name of the layout matching the group, layout ID, and privacy.
    com.liferay.portal.kernel.model.Layout
    updateName(long plid, String name, String languageId)
    Updates the name of the layout matching the primary key.
    com.liferay.portal.kernel.model.Layout
    updateParentLayoutId(long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
    Updates the parent layout ID of the layout matching the group, layout ID, and privacy.
    com.liferay.portal.kernel.model.Layout
    updateParentLayoutId(long plid, long parentPlid)
    Updates the parent layout ID of the layout matching the primary key.
    com.liferay.portal.kernel.model.Layout
    updateParentLayoutIdAndPriority(long plid, long parentPlid, int priority)
    Updates the parent layout ID and priority of the layout.
    com.liferay.portal.kernel.model.Layout
    updatePriority(long groupId, boolean privateLayout, long layoutId, int priority)
    Updates the priority of the layout matching the group, layout ID, and privacy.
    com.liferay.portal.kernel.model.Layout
    updatePriority(long groupId, boolean privateLayout, long layoutId, long nextLayoutId, long previousLayoutId)
    Updates the priority of the layout matching the group, layout ID, and privacy, setting the layout's priority based on the priorities of the next and previous layouts.
    com.liferay.portal.kernel.model.Layout
    updatePriority(long plid, int priority)
    Updates the priority of the layout matching the primary key.
    com.liferay.portal.kernel.model.Layout
    updateType(long plid, String type)
     

    Methods inherited from class com.liferay.portal.kernel.service.BaseServiceImpl

    getClassLoader, getGuestOrUser, getGuestOrUserId, getPermissionChecker, getUser, getUserId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LayoutServiceImpl

      public LayoutServiceImpl()
  • Method Details

    • addLayout

      public com.liferay.portal.kernel.model.Layout addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, long classNameId, long classPK, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale,String> friendlyURLMap, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a layout with additional parameters.

      This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.

      Parameters:
      externalReferenceCode - the layout's external reference code
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      parentLayoutId - the layout ID of the parent layout (optionally LayoutConstants.DEFAULT_PARENT_LAYOUT_ID)
      classNameId - the class name ID of the entity
      classPK - the primary key of the entity
      localeNamesMap - the layout's locales and localized names
      localeTitlesMap - the layout's locales and localized titles
      descriptionMap - the layout's locales and localized descriptions
      keywordsMap - the layout's locales and localized keywords
      robotsMap - the layout's locales and localized robots
      type - the layout's type (optionally LayoutConstants.TYPE_PORTLET). The possible types can be found in LayoutConstants.
      typeSettings - the settings to load the unicode properties object. See #fastLoad(String).
      hidden - whether the layout is hidden
      system - whether the layout is system
      friendlyURLMap - the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.normalize(String).
      masterLayoutPlid - the primary key of the master layout
      serviceContext - the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute named layoutUpdateable can be used to specify whether site administrators can modify this page within their site.
      Returns:
      the layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • addLayout

      public com.liferay.portal.kernel.model.Layout addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale,String> friendlyURLMap, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a layout with additional parameters.

      This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.

      Parameters:
      externalReferenceCode - the layout's external reference code
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      parentLayoutId - the layout ID of the parent layout (optionally LayoutConstants.DEFAULT_PARENT_LAYOUT_ID)
      localeNamesMap - the layout's locales and localized names
      localeTitlesMap - the layout's locales and localized titles
      descriptionMap - the layout's locales and localized descriptions
      keywordsMap - the layout's locales and localized keywords
      robotsMap - the layout's locales and localized robots
      type - the layout's type (optionally LayoutConstants.TYPE_PORTLET). The possible types can be found in LayoutConstants.
      typeSettings - the settings to load the unicode properties object. See #fastLoad(String).
      hidden - whether the layout is hidden
      friendlyURLMap - the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.normalize(String).
      masterLayoutPlid - the primary key of the master layout
      serviceContext - the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute named layoutUpdateable can be used to specify whether site administrators can modify this page within their site.
      Returns:
      the layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • addLayout

      public com.liferay.portal.kernel.model.Layout addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale,String> friendlyURLMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a layout with additional parameters.

      This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.

      Parameters:
      externalReferenceCode - the layout's external reference code
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      parentLayoutId - the layout ID of the parent layout (optionally LayoutConstants.DEFAULT_PARENT_LAYOUT_ID)
      localeNamesMap - the layout's locales and localized names
      localeTitlesMap - the layout's locales and localized titles
      descriptionMap - the layout's locales and localized descriptions
      keywordsMap - the layout's locales and localized keywords
      robotsMap - the layout's locales and localized robots
      type - the layout's type (optionally LayoutConstants.TYPE_PORTLET). The possible types can be found in LayoutConstants.
      typeSettings - the settings to load the unicode properties object. See #fastLoad(String).
      hidden - whether the layout is hidden
      friendlyURLMap - the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.normalize(String).
      serviceContext - the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute named layoutUpdateable can be used to specify whether site administrators can modify this page within their site.
      Returns:
      the layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • addLayout

      public com.liferay.portal.kernel.model.Layout addLayout(String externalReferenceCode, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, String friendlyURL, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Adds a layout with single entry maps for name, title, and description to the default locale.

      This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.

      Parameters:
      externalReferenceCode - the layout's external reference code
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      parentLayoutId - the layout ID of the parent layout (optionally LayoutConstants.DEFAULT_PARENT_LAYOUT_ID)
      name - the layout's locales and localized names
      title - the layout's locales and localized titles
      description - the layout's locales and localized descriptions
      type - the layout's type (optionally LayoutConstants.TYPE_PORTLET). The possible types can be found in LayoutConstants.
      hidden - whether the layout is hidden
      friendlyURL - the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.normalize(String).
      serviceContext - the service context to be applied. Must set the UUID for the layout. Can specify the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute named layoutUpdateable can be used to specify whether site administrators can modify this page within their site.
      Returns:
      the layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • addTempFileEntry

      public com.liferay.portal.kernel.repository.model.FileEntry addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream, String mimeType) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • copyLayout

      public com.liferay.portal.kernel.model.Layout copyLayout(long groupId, boolean privateLayout, Map<Locale,String> localeNamesMap, boolean hidden, boolean system, boolean copyPermissions, long sourcePlid, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteLayout

      public void deleteLayout(long groupId, boolean privateLayout, long layoutId, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the layout with the primary key, also deleting the layout's child layouts, and associated resources.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      serviceContext - the service context to be applied
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • deleteLayout

      public void deleteLayout(long plid, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the layout with the plid, also deleting the layout's child layouts, and associated resources.
      Parameters:
      plid - the primary key of the layout
      serviceContext - the service context to be applied
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • deleteLayout

      public void deleteLayout(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteTempFileEntry

      public void deleteTempFileEntry(long groupId, String folderName, String fileName) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • fetchFirstLayout

      public com.liferay.portal.kernel.model.Layout fetchFirstLayout(long groupId, boolean privateLayout, boolean published)
    • fetchLayout

      public com.liferay.portal.kernel.model.Layout fetchLayout(long groupId, boolean privateLayout, long layoutId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • fetchLayoutByExternalReferenceCode

      public com.liferay.portal.kernel.model.Layout fetchLayoutByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • fetchLayoutPlid

      public long fetchLayoutPlid(String uuid, long groupId, boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getAncestorLayouts

      public List<com.liferay.portal.kernel.model.Layout> getAncestorLayouts(long plid) throws com.liferay.portal.kernel.exception.PortalException
      Returns all the ancestor layouts of the layout.
      Parameters:
      plid - the primary key of the layout
      Returns:
      the ancestor layouts of the layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getControlPanelLayoutPlid

      public long getControlPanelLayoutPlid() throws com.liferay.portal.kernel.exception.PortalException
      Returns the control panel layout's plid.
      Returns:
      the control panel layout's plid
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception is occured
    • getDefaultPlid

      public long getDefaultPlid(long groupId, boolean privateLayout)
      Returns primary key of the matching default layout for the group.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      Returns:
      the primary key of the default layout for the group; LayoutConstants.DEFAULT_PLID) otherwise
    • getDefaultPlid

      public long getDefaultPlid(long groupId, long scopeGroupId, boolean privateLayout, String portletId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the primary key of the default layout for the group.
      Parameters:
      groupId - the primary key of the group
      scopeGroupId - the primary key of the scope group. See ServiceContext.getScopeGroupId().
      privateLayout - whether the layout is private to the group
      portletId - the primary key of the portlet
      Returns:
      Returns the primary key of the default layout group; LayoutConstants.DEFAULT_PLID otherwise
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getDefaultPlid

      @ThreadLocalCachable public long getDefaultPlid(long groupId, long scopeGroupId, String portletId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayoutByExternalReferenceCode

      public com.liferay.portal.kernel.model.Layout getLayoutByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayoutByUuidAndGroupId

      public com.liferay.portal.kernel.model.Layout getLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException
      Returns the layout matching the UUID, group, and privacy.
      Parameters:
      uuid - the layout's UUID
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      Returns:
      the matching layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getLayoutName

      public String getLayoutName(long groupId, boolean privateLayout, long layoutId, String languageId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the name of the layout.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      languageId - the primary key of the language. For more information See Locale.
      Returns:
      the layout's name
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getLayoutPlid

      public long getLayoutPlid(String uuid, long groupId, boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException
      Returns the layout's plid that matches the parameters.
      Parameters:
      uuid - the layout's UUID
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      Returns:
      the matching layout's plid
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getLayoutReferences

      public com.liferay.portal.kernel.model.LayoutReference[] getLayoutReferences(long companyId, String portletId, String preferencesKey, String preferencesValue)
      Returns the layout references for all the layouts that belong to the company and belong to the portlet that matches the preferences.
      Parameters:
      companyId - the primary key of the company
      portletId - the primary key of the portlet
      preferencesKey - the portlet's preference key
      preferencesValue - the portlet's preference value
      Returns:
      the layout references of the matching layouts
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout)
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, String type) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, String type, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Layout> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int[] statuses, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Layout> orderByComparator) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, String type)
    • getLayouts

      public List<com.liferay.portal.kernel.model.Layout> getLayouts(long groupId, String type, int start, int end)
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout)
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout, long parentLayoutId)
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout, long parentLayoutId, int priority)
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout, String type)
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout, String keywords, String[] types) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayoutsCount

      public int getLayoutsCount(long groupId, boolean privateLayout, String keywords, String[] types, int[] statuses) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getLayoutsCount

      public int getLayoutsCount(long groupId, String type)
    • getTempFileNames

      public String[] getTempFileNames(long groupId, String folderName) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • hasLayout

      public boolean hasLayout(String uuid, long groupId, boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException
      Returns true if there is a matching layout with the UUID, group, and privacy.
      Parameters:
      uuid - the layout's UUID
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      Returns:
      true if the layout is found; false otherwise
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • hasPortletId

      public boolean hasPortletId(long plid, String portletId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • publishLayout

      public com.liferay.portal.kernel.model.Layout publishLayout(long plid) throws Exception
      Throws:
      Exception
    • schedulePublishToLive

      public void schedulePublishToLive(long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, Map<String,String[]> parameterMap, String groupName, String cronText, Date schedulerStartDate, Date schedulerEndDate, String description) throws com.liferay.portal.kernel.exception.PortalException
      Schedules a range of layouts to be published.
      Parameters:
      sourceGroupId - the primary key of the source group
      targetGroupId - the primary key of the target group
      privateLayout - whether the layout is private to the group
      layoutIds - the layouts considered for publishing, specified by the layout IDs
      parameterMap - the mapping of parameters indicating which information will be used. See PortletDataHandlerKeys.
      groupName - the group name (optionally DestinationNames.LAYOUTS_LOCAL_PUBLISHER). See DestinationNames.
      cronText - the cron text. See CronTextUtil.getCronText(javax.portlet.PortletRequest, java.util.Calendar, boolean, int)
      schedulerStartDate - the scheduler start date
      schedulerEndDate - the scheduler end date
      description - the scheduler description
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • schedulePublishToRemote

      public void schedulePublishToRemote(long sourceGroupId, boolean privateLayout, Map<Long,Boolean> layoutIdMap, Map<String,String[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout, Date startDate, Date endDate, String groupName, String cronText, Date schedulerStartDate, Date schedulerEndDate, String description) throws com.liferay.portal.kernel.exception.PortalException
      Schedules a range of layouts to be stored.
      Parameters:
      sourceGroupId - the primary key of the source group
      privateLayout - whether the layout is private to the group
      layoutIdMap - the layouts considered for publishing, specified by the layout IDs and booleans indicating whether they have children
      parameterMap - the mapping of parameters indicating which information will be used. See PortletDataHandlerKeys.
      remoteAddress - the remote address
      remotePort - the remote port
      remotePathContext - the remote path context
      secureConnection - whether the connection is secure
      remoteGroupId - the primary key of the remote group
      remotePrivateLayout - whether remote group's layout is private
      startDate - the start date
      endDate - the end date
      groupName - the group name. Optionally DestinationNames.LAYOUTS_LOCAL_PUBLISHER). See DestinationNames.
      cronText - the cron text. See CronTextUtil.getCronText(javax.portlet.PortletRequest, java.util.Calendar, boolean, int)
      schedulerStartDate - the scheduler start date
      schedulerEndDate - the scheduler end date
      description - the scheduler description
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • setLayouts

      public void setLayouts(long groupId, boolean privateLayout, long parentLayoutId, long[] layoutIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Sets the layouts for the group, replacing and prioritizing all layouts of the parent layout.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      parentLayoutId - the layout ID of the parent layout
      layoutIds - the primary keys of the layouts
      serviceContext - the service context to be applied
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • unschedulePublishToLive

      public void unschedulePublishToLive(long groupId, String jobName, String groupName) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the job from the scheduler's queue.
      Parameters:
      groupId - the primary key of the group
      jobName - the job name
      groupName - the group name (optionally DestinationNames.LAYOUTS_LOCAL_PUBLISHER). See DestinationNames.
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • unschedulePublishToRemote

      public void unschedulePublishToRemote(long groupId, String jobName, String groupName) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the job from the scheduler's persistent queue.
      Parameters:
      groupId - the primary key of the group
      jobName - the job name
      groupName - the group name (optionally DestinationNames.LAYOUTS_LOCAL_PUBLISHER). See DestinationNames.
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateIconImage

      public com.liferay.portal.kernel.model.Layout updateIconImage(long plid, byte[] bytes) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateLayout

      public com.liferay.portal.kernel.model.Layout updateLayout(long groupId, boolean privateLayout, long layoutId, long parentLayoutId, Map<Locale,String> localeNamesMap, Map<Locale,String> localeTitlesMap, Map<Locale,String> descriptionMap, Map<Locale,String> keywordsMap, Map<Locale,String> robotsMap, String type, boolean hidden, Map<Locale,String> friendlyURLMap, boolean hasIconImage, byte[] iconBytes, long styleBookEntryId, long faviconFileEntryId, long masterLayoutPlid, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Updates the layout with additional parameters.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      parentLayoutId - the layout ID of the layout's new parent layout
      localeNamesMap - the layout's locales and localized names
      localeTitlesMap - the layout's locales and localized titles
      descriptionMap - the locales and localized descriptions to merge (optionally null)
      keywordsMap - the locales and localized keywords to merge (optionally null)
      robotsMap - the locales and localized robots to merge (optionally null)
      type - the layout's new type (optionally LayoutConstants.TYPE_PORTLET)
      hidden - whether the layout is hidden
      friendlyURLMap - the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed see FriendlyURLNormalizerUtil.normalize(String).
      hasIconImage - if the layout has a custom icon image
      iconBytes - the byte array of the layout's new icon image
      styleBookEntryId - the primary key of the style book entry
      faviconFileEntryId - the file entry ID of the layout's new favicon
      masterLayoutPlid - the primary key of the master layout
      serviceContext - the service context to be applied. Can set the modification date and expando bridge attributes for the layout.
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateLayout

      public com.liferay.portal.kernel.model.Layout updateLayout(long groupId, boolean privateLayout, long layoutId, String typeSettings) throws com.liferay.portal.kernel.exception.PortalException
      Updates the layout replacing its type settings.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      typeSettings - the settings to load the unicode properties object. See #fastLoad(String).
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateLookAndFeel

      public com.liferay.portal.kernel.model.Layout updateLookAndFeel(long groupId, boolean privateLayout, long layoutId, String themeId, String colorSchemeId, String css) throws com.liferay.portal.kernel.exception.PortalException
      Updates the look and feel of the layout.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      themeId - the primary key of the layout's new theme
      colorSchemeId - the primary key of the layout's new color scheme
      css - the layout's new CSS
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateName

      public com.liferay.portal.kernel.model.Layout updateName(long groupId, boolean privateLayout, long layoutId, String name, String languageId) throws com.liferay.portal.kernel.exception.PortalException
      Updates the name of the layout matching the group, layout ID, and privacy.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      name - the layout's new name
      languageId - the primary key of the language. For more information see Locale.
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateName

      public com.liferay.portal.kernel.model.Layout updateName(long plid, String name, String languageId) throws com.liferay.portal.kernel.exception.PortalException
      Updates the name of the layout matching the primary key.
      Parameters:
      plid - the primary key of the layout
      name - the name to be assigned
      languageId - the primary key of the language. For more information see Locale.
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateParentLayoutId

      public com.liferay.portal.kernel.model.Layout updateParentLayoutId(long groupId, boolean privateLayout, long layoutId, long parentLayoutId) throws com.liferay.portal.kernel.exception.PortalException
      Updates the parent layout ID of the layout matching the group, layout ID, and privacy.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      parentLayoutId - the layout ID to be assigned to the parent layout
      Returns:
      the matching layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateParentLayoutId

      public com.liferay.portal.kernel.model.Layout updateParentLayoutId(long plid, long parentPlid) throws com.liferay.portal.kernel.exception.PortalException
      Updates the parent layout ID of the layout matching the primary key. If a layout matching the parent primary key is found, the layout ID of that layout is assigned, otherwise LayoutConstants.DEFAULT_PARENT_LAYOUT_ID is assigned.
      Parameters:
      plid - the primary key of the layout
      parentPlid - the primary key of the parent layout
      Returns:
      the layout matching the primary key
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateParentLayoutIdAndPriority

      public com.liferay.portal.kernel.model.Layout updateParentLayoutIdAndPriority(long plid, long parentPlid, int priority) throws com.liferay.portal.kernel.exception.PortalException
      Updates the parent layout ID and priority of the layout.
      Parameters:
      plid - the primary key of the layout
      parentPlid - the primary key of the parent layout
      priority - the layout's new priority
      Returns:
      the layout matching the primary key
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updatePriority

      public com.liferay.portal.kernel.model.Layout updatePriority(long groupId, boolean privateLayout, long layoutId, int priority) throws com.liferay.portal.kernel.exception.PortalException
      Updates the priority of the layout matching the group, layout ID, and privacy.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      priority - the layout's new priority
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updatePriority

      public com.liferay.portal.kernel.model.Layout updatePriority(long groupId, boolean privateLayout, long layoutId, long nextLayoutId, long previousLayoutId) throws com.liferay.portal.kernel.exception.PortalException
      Updates the priority of the layout matching the group, layout ID, and privacy, setting the layout's priority based on the priorities of the next and previous layouts.
      Parameters:
      groupId - the primary key of the group
      privateLayout - whether the layout is private to the group
      layoutId - the layout ID of the layout
      nextLayoutId - the layout ID of the next layout
      previousLayoutId - the layout ID of the previous layout
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updatePriority

      public com.liferay.portal.kernel.model.Layout updatePriority(long plid, int priority) throws com.liferay.portal.kernel.exception.PortalException
      Updates the priority of the layout matching the primary key.
      Parameters:
      plid - the primary key of the layout
      priority - the layout's new priority
      Returns:
      the updated layout
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • updateType

      public com.liferay.portal.kernel.model.Layout updateType(long plid, String type) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkLayoutTypeSettings

      protected void checkLayoutTypeSettings(com.liferay.portal.kernel.model.Layout layout, String originalTypeSettings, String newTypeSettings) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • filterLayouts

      protected List<com.liferay.portal.kernel.model.Layout> filterLayouts(List<com.liferay.portal.kernel.model.Layout> layouts)
    • filterLayouts

      protected List<com.liferay.portal.kernel.model.Layout> filterLayouts(List<com.liferay.portal.kernel.model.Layout> layouts, int start, int end) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getPortletIds

      protected List<String> getPortletIds(com.liferay.portal.kernel.model.Layout layout, String typeSettings)