Class ServicelayerManager

All Implemented Interfaces:
ItemLifecycleListener, JaloSessionListener, Serializable

public class ServicelayerManager extends GeneratedServicelayerManager implements JaloSessionListener
See Also:
  • Field Details

    • ITEMSAVEDVALUESRELATIONSAVEDVALUESHANDLER

      protected static final OneToManyHandler<SavedValues> ITEMSAVEDVALUESRELATIONSAVEDVALUESHANDLER
      for hmc legacy
      OneToManyHandler for handling 1:n SAVEDVALUES's relation attributes from 'many' side.
  • Constructor Details

    • ServicelayerManager

      public ServicelayerManager()
  • Method Details

    • init

      public void init()
      Description copied from class: Manager
      called once for each tenant, so this method fits best to perform some initialization stuff
      Overrides:
      init in class Manager
    • getName

      public String getName()
      Overrides:
      getName in class GeneratedServicelayerManager
    • getInstance

      public static ServicelayerManager getInstance()
    • notifyAttributesChanged

      protected void notifyAttributesChanged()
    • notifyItemRemoval

      protected void notifyItemRemoval(SessionContext ctx, Item item)
      Description copied from class: Manager
      TODO improve API doc Is called just before a item is being removed. No exception should be thrown here. Use Manager.checkBeforeItemRemoval(SessionContext, Item) instead.

      This method does nothing and may be overridden.

      Overrides:
      notifyItemRemoval in class Extension
      Parameters:
      ctx - the currency session context
      item - the item which is going to be removed
    • afterItemCreation

      public void afterItemCreation(SessionContext ctx, ComposedType type, Item createdItem, Item.ItemAttributeMap attributes) throws JaloBusinessException
      Description copied from class: Manager
      This method will be called after an item was created.
      Specified by:
      afterItemCreation in interface ItemLifecycleListener
      Overrides:
      afterItemCreation in class Manager
      Parameters:
      ctx - the currency session context
      type - the type of the item which will be created
      createdItem - the created item
      Throws:
      JaloBusinessException
      See Also:
    • createEssentialData

      public void createEssentialData(Map<String,String> params, JspContext jspc)
      Overrides:
      createEssentialData in class Extension
    • afterSessionCreation

      public void afterSessionCreation(JaloSession session)
      Description copied from interface: JaloSessionListener
      Notifies the extension manager if a session was just created.
      Specified by:
      afterSessionCreation in interface JaloSessionListener
      Parameters:
      session - new session
      See Also:
      • JaloSession.createInstance(java.util.Map, Class)
    • afterSessionUserChange

      public void afterSessionUserChange(JaloSession session, User previous)
      Description copied from interface: JaloSessionListener
      Notifies the extension manager if the current session user was changed
      Specified by:
      afterSessionUserChange in interface JaloSessionListener
      Parameters:
      session - current session
      previous - previous user
      See Also:
    • afterSessionAttributeChange

      public void afterSessionAttributeChange(JaloSession session, String attributeName, Object value)
      Description copied from interface: JaloSessionListener
      Notify if the extension manager if the session attributes was changed
      Specified by:
      afterSessionAttributeChange in interface JaloSessionListener
      Parameters:
      session - current session
      attributeName - name of changed attribute
      value - new value
    • isEventActiveAttribute

      protected boolean isEventActiveAttribute(String attributeName)
    • beforeSessionClose

      public void beforeSessionClose(JaloSession session)
      Description copied from interface: JaloSessionListener
      Notifies the extension manager if a session will be closed.
      Specified by:
      beforeSessionClose in interface JaloSessionListener
      Parameters:
      session - current session
      See Also:
    • notifyTenantRestart

      public void notifyTenantRestart(Tenant tenant)
    • notifyInitializationEnd

      public void notifyInitializationEnd(Map<String,String> params, JspContext ctx) throws Exception
      Overrides:
      notifyInitializationEnd in class Extension
      Throws:
      Exception
    • notifyInitializationStart

      public void notifyInitializationStart(Map<String,String> params, JspContext ctx) throws Exception
      Overrides:
      notifyInitializationStart in class Extension
      Throws:
      Exception
    • getSessionArtNamesFilter

      public List<String> getSessionArtNamesFilter()
      Returns:
      the sessionArtNamesFilter
    • getSavedValues

      public Set<SavedValues> getSavedValues(Item item)
      Getter of the Item.savedValues attribute.
      Returns:
      the savedValues
    • getOrCreateUserProfile

      public UserProfile getOrCreateUserProfile()
      Gets the user profile of the current user. If it is not created yet, it will be created.
      Returns:
      user profile of current user
    • getAllWritableLanguages

      public Set<Language> getAllWritableLanguages()
      Returns a Set containing all 'writable languages' for the current user as configured in its user profile. If no set is specified at the user profile all groups which the user is a member of will be searched for a property called 'writablelanguages' (which should contain Collections of Languages) and if such properties exist, all contained languages are returned.
      Note: This set will be cached and rebuild per request.
      Returns:
      a Set containing all 'writable languages' for the current user.
    • getAllReadableLanguages

      public Set<Language> getAllReadableLanguages()
      Returns a Set containing all 'readable languages' for the current user as configured in its user profile. If no set is specified at the user profile all groups which the user is a member of will be searched for a property called 'readablelanguages' (which should contain Collections of Languages) and if such properties exist, all contained languages are returned.
      Note: This set will be cached and rebuild per request.
      Returns:
      a Set containing all 'readable languages' for the current user.
    • getAllLanguages

      public Set<Language> getAllLanguages()
      Returns all existing Language objects for the given JaloSession.
      Note: This set will be cached and rebuild per request.
      Returns:
      a Set containing all existing Language objects for the given JaloSession.
    • getUserprofile

      public UserProfile getUserprofile(User item)
      Generated method - Getter of the User.userprofile attribute.
      Returns:
      the userprofile
    • getUserprofile

      public UserProfile getUserprofile(SessionContext ctx, User item)
      Generated method - Getter of the User.userprofile attribute.
      Returns:
      the userprofile
    • setUserprofile

      public void setUserprofile(SessionContext ctx, User item, UserProfile value)
      Generated method - Setter of the User.userprofile attribute.
      Parameters:
      value - the userprofile
    • setUserprofile

      public void setUserprofile(User item, UserProfile value)
      Generated method - Setter of the User.userprofile attribute.
      Parameters:
      value - the userprofile
    • notifyClusterAboutTenantInitialization

      public void notifyClusterAboutTenantInitialization(Tenant tenant)
    • publishEvent

      public void publishEvent(AbstractEvent event)
    • getServiceLayerEnumerationValue

      public <T extends HybrisEnumValue> T getServiceLayerEnumerationValue(String enumerationCode, String valueCode)
    • checkBeforeInitialization

      public void checkBeforeInitialization(JspContext ctx, boolean forceInit) throws Exception
      Description copied from class: Extension
      Override this method to add custom checks that should be executed before system initialization or update. The check should throw exception in case the initialization/update should not be performed
      Overrides:
      checkBeforeInitialization in class Extension
      Throws:
      Exception