Class DefaultSpaceApplicationHandler

java.lang.Object
org.exoplatform.social.core.space.impl.DefaultSpaceApplicationHandler
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin, org.exoplatform.social.core.space.spi.SpaceApplicationHandler

public class DefaultSpaceApplicationHandler extends Object implements org.exoplatform.social.core.space.spi.SpaceApplicationHandler
Default implementation for working with space applications.
Since:
OCt 17, 2008
Author:
dang.tung, hoatle (hoatlevan at gmail dot com)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected static final String
    The {groupId} preference value pattern
    protected org.exoplatform.portal.mop.service.LayoutService
     
    protected static final org.exoplatform.services.log.Log
     
    protected static final String
    The {modifiedGroupId} preference value pattern
    protected org.exoplatform.portal.module.ModuleRegistry
     
    static final String
     
    protected org.exoplatform.portal.mop.service.NavigationService
     
    protected static final String
    The {pageName} preference value pattern
    protected static final String
    The {pageUrl} preference value pattern
    protected org.exoplatform.portal.mop.storage.PageStorage
     
    static final String
     
    protected org.exoplatform.social.core.space.spi.SpaceService
     
    protected org.exoplatform.social.core.space.spi.SpaceTemplateService
     
    protected static final String
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultSpaceApplicationHandler(org.exoplatform.container.xml.InitParams params, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.portal.mop.service.NavigationService navigationService, org.exoplatform.portal.mop.storage.PageStorage pageService, org.exoplatform.social.core.space.spi.SpaceTemplateService spaceTemplateService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activateApplication(org.exoplatform.social.core.space.model.Space space, String appId, String appName)
    protected org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>>
    createPageNodeFromApplication(org.exoplatform.portal.mop.navigation.NavigationContext navContext, org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>> nodeCtx, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceApplication spaceApplication, String appName, boolean isRoot)
    Creates page node from application.
    protected org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet>
    createPortletApplication(String instanceId, org.exoplatform.social.core.space.model.Space space, boolean isRoot)
    Creates portlet application from instanceId
    protected org.exoplatform.portal.config.model.Page
    createSpacePage(org.exoplatform.portal.config.UserPortalConfigService userPortalConfigService, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.Application app, org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet> portletApplication, boolean isRoot)
     
    protected void
    deactivateApplicationClassic(org.exoplatform.social.core.space.model.Space space, String appId)
    Deactivates an application in a space
    void
    deactiveApplication(org.exoplatform.social.core.space.model.Space space, String appId)
    void
    deInitApp(org.exoplatform.social.core.space.model.Space space)
    protected org.exoplatform.social.core.space.Application
    Gets an application by its id.
     
    protected org.exoplatform.portal.module.ModuleRegistry
     
    protected org.exoplatform.social.core.space.SpaceApplication
    getSpaceApplication(org.exoplatform.social.core.space.SpaceTemplate spaceTemplate, String appId)
     
    protected org.exoplatform.social.core.space.spi.SpaceService
     
    protected org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>>
    getSpaceUserNode(org.exoplatform.social.core.space.model.Space space)
     
    protected String
    getSubstituteValueFromPattern(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceApplication spaceApplication, String pattern)
     
    protected org.exoplatform.portal.config.UserPortalConfigService
    Gets userPortalConfigService for the usage of creating new page from page template
    void
    initApps(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceTemplate spaceTemplate)
    void
    installApplication(org.exoplatform.social.core.space.model.Space space, String appId)
    protected boolean
    isPortletActive(String potletFullId)
     
    void
    moveApplication(org.exoplatform.social.core.space.model.Space space, String appId, int transition)
     
    void
    removeApplication(org.exoplatform.social.core.space.model.Space space, String appId, String appName)
    protected void
    removeApplicationClassic(org.exoplatform.social.core.space.model.Space space, String appId, String appName)
    Removes an classic-type application from a space
    void
    removeApplications(org.exoplatform.social.core.space.model.Space space)
    void
    restoreApplicationLayout(org.exoplatform.social.core.space.model.Space space, String appId)
     
    protected ArrayList<org.exoplatform.portal.config.model.ModelObject>
    setContainerById(ArrayList<org.exoplatform.portal.config.model.ModelObject> childs, org.exoplatform.portal.config.model.Container container)
    Sets container by Id
    void
     
    void
     
    protected void
    setPage(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.Application app, org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet> portletApplication, org.exoplatform.portal.config.model.Page page)
     
    protected void
    setPermissionForPage(ArrayList<org.exoplatform.portal.config.model.ModelObject> children, String perm)
    Sets permission for page.

    Methods inherited from class java.lang.Object

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

    • LOG

      protected static final org.exoplatform.services.log.Log LOG
    • NAME

      public static final String NAME
      See Also:
    • TEMPLATE_NAME_PARAM

      protected static final String TEMPLATE_NAME_PARAM
      See Also:
    • SPACE_TEMPLATE_PAGE_ID

      public static final String SPACE_TEMPLATE_PAGE_ID
      See Also:
    • APPLICATION_CONTAINER

      public static final String APPLICATION_CONTAINER
      See Also:
    • GROUP_ID_PREFERENCE

      protected static final String GROUP_ID_PREFERENCE
      The {groupId} preference value pattern
      Since:
      1.2.0-GA
      See Also:
    • MODIFIED_GROUP_ID_PREFERENCE

      protected static final String MODIFIED_GROUP_ID_PREFERENCE
      The {modifiedGroupId} preference value pattern
      Since:
      1.2.0-GA
      See Also:
    • PAGE_NAME_PREFERENCE

      protected static final String PAGE_NAME_PREFERENCE
      The {pageName} preference value pattern
      Since:
      1.2.0-GA
      See Also:
    • PAGE_URL_PREFERENCE

      protected static final String PAGE_URL_PREFERENCE
      The {pageUrl} preference value pattern
      Since:
      1.2.0-GA
      See Also:
    • layoutService

      protected org.exoplatform.portal.mop.service.LayoutService layoutService
    • pageStorage

      protected org.exoplatform.portal.mop.storage.PageStorage pageStorage
    • spaceService

      protected org.exoplatform.social.core.space.spi.SpaceService spaceService
    • moduleRegistry

      protected org.exoplatform.portal.module.ModuleRegistry moduleRegistry
    • spaceTemplateService

      protected org.exoplatform.social.core.space.spi.SpaceTemplateService spaceTemplateService
    • templateName

      protected String templateName
  • Constructor Details

    • DefaultSpaceApplicationHandler

      public DefaultSpaceApplicationHandler(org.exoplatform.container.xml.InitParams params, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.portal.mop.service.NavigationService navigationService, org.exoplatform.portal.mop.storage.PageStorage pageService, org.exoplatform.social.core.space.spi.SpaceTemplateService spaceTemplateService)
  • Method Details

    • initApps

      public void initApps(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceTemplate spaceTemplate) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      initApps in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • deInitApp

      public void deInitApp(org.exoplatform.social.core.space.model.Space space) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      deInitApp in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • activateApplication

      public void activateApplication(org.exoplatform.social.core.space.model.Space space, String appId, String appName) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      activateApplication in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • deactiveApplication

      public void deactiveApplication(org.exoplatform.social.core.space.model.Space space, String appId) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      deactiveApplication in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • installApplication

      public void installApplication(org.exoplatform.social.core.space.model.Space space, String appId) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      installApplication in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • removeApplication

      public void removeApplication(org.exoplatform.social.core.space.model.Space space, String appId, String appName) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      removeApplication in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • removeApplications

      public void removeApplications(org.exoplatform.social.core.space.model.Space space) throws org.exoplatform.social.core.space.SpaceException
      Specified by:
      removeApplications in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • moveApplication

      public void moveApplication(org.exoplatform.social.core.space.model.Space space, String appId, int transition) throws Exception
      Specified by:
      moveApplication in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      Exception
    • restoreApplicationLayout

      public void restoreApplicationLayout(org.exoplatform.social.core.space.model.Space space, String appId) throws Exception
      Specified by:
      restoreApplicationLayout in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
      Throws:
      Exception
    • getName

      public String getName()
      Specified by:
      getName in interface org.exoplatform.container.component.ComponentPlugin
      Specified by:
      getName in interface org.exoplatform.social.core.space.spi.SpaceApplicationHandler
    • setName

      public void setName(String s)
      Specified by:
      setName in interface org.exoplatform.container.component.ComponentPlugin
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.exoplatform.container.component.ComponentPlugin
    • setDescription

      public void setDescription(String s)
      Specified by:
      setDescription in interface org.exoplatform.container.component.ComponentPlugin
    • deactivateApplicationClassic

      protected void deactivateApplicationClassic(org.exoplatform.social.core.space.model.Space space, String appId)
      Deactivates an application in a space
      Parameters:
      space -
      appId -
    • removeApplicationClassic

      protected void removeApplicationClassic(org.exoplatform.social.core.space.model.Space space, String appId, String appName) throws org.exoplatform.social.core.space.SpaceException
      Removes an classic-type application from a space
      Parameters:
      space -
      appId -
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • createPageNodeFromApplication

      protected org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>> createPageNodeFromApplication(org.exoplatform.portal.mop.navigation.NavigationContext navContext, org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>> nodeCtx, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceApplication spaceApplication, String appName, boolean isRoot) throws org.exoplatform.social.core.space.SpaceException
      Creates page node from application. - Creates Application instance from appId.
      - Creates Page instance and set the newly-created application for that page; adds application to container.
      - Creates PageNode instance and returns that pageNode.
      Parameters:
      space -
      spaceApplication -
      isRoot -
      Returns:
      Throws:
      org.exoplatform.social.core.space.SpaceException
      Since:
      1.2.0-GA
    • createSpacePage

      protected org.exoplatform.portal.config.model.Page createSpacePage(org.exoplatform.portal.config.UserPortalConfigService userPortalConfigService, org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.Application app, org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet> portletApplication, boolean isRoot) throws Exception
      Throws:
      Exception
    • getApplication

      protected org.exoplatform.social.core.space.Application getApplication(String appId) throws org.exoplatform.social.core.space.SpaceException
      Gets an application by its id.
      Parameters:
      appId -
      Returns:
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • setPage

      protected void setPage(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.Application app, org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet> portletApplication, org.exoplatform.portal.config.model.Page page)
    • setPermissionForPage

      protected void setPermissionForPage(ArrayList<org.exoplatform.portal.config.model.ModelObject> children, String perm)
      Sets permission for page.
      Parameters:
      children -
      perm -
    • setContainerById

      protected ArrayList<org.exoplatform.portal.config.model.ModelObject> setContainerById(ArrayList<org.exoplatform.portal.config.model.ModelObject> childs, org.exoplatform.portal.config.model.Container container)
      Sets container by Id
      Parameters:
      childs -
      container -
      Returns:
    • createPortletApplication

      protected org.exoplatform.portal.config.model.Application<org.exoplatform.portal.pom.spi.portlet.Portlet> createPortletApplication(String instanceId, org.exoplatform.social.core.space.model.Space space, boolean isRoot)
      Creates portlet application from instanceId
      Parameters:
      instanceId -
      Returns:
    • getSubstituteValueFromPattern

      protected String getSubstituteValueFromPattern(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.space.SpaceApplication spaceApplication, String pattern)
    • getUserPortalConfigService

      protected org.exoplatform.portal.config.UserPortalConfigService getUserPortalConfigService()
      Gets userPortalConfigService for the usage of creating new page from page template
      Returns:
    • getSpaceService

      protected org.exoplatform.social.core.space.spi.SpaceService getSpaceService()
    • isPortletActive

      protected boolean isPortletActive(String potletFullId)
    • getModuleRegistry

      protected org.exoplatform.portal.module.ModuleRegistry getModuleRegistry()
    • getSpaceUserNode

      protected org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<?>> getSpaceUserNode(org.exoplatform.social.core.space.model.Space space) throws Exception
      Throws:
      Exception
    • getSpaceApplication

      protected org.exoplatform.social.core.space.SpaceApplication getSpaceApplication(org.exoplatform.social.core.space.SpaceTemplate spaceTemplate, String appId) throws org.exoplatform.social.core.space.SpaceException
      Throws:
      org.exoplatform.social.core.space.SpaceException