Class ExtensibleItem

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    Link, LocalizableItem

    public abstract class ExtensibleItem
    extends Item
    Each extensible item can have several additional properties.

    See our Jalo extension tutorial for more informations.

    The following state chart presents a the life cycle of a stageable property. Please not that only stageable items have stageable properties. Non-stagable properties have only the states does not exist and unchanged.

    Note: If you are using Serializable objects as property values, be sure that the declaring class is in the serverside's classpath. This is a restriction in the current release of hybris platform.

    See Also:
    Serialized Form
    • Constructor Detail

      • ExtensibleItem

        public ExtensibleItem()
    • Method Detail

      • getAllProperties

        public java.util.Map getAllProperties()
        Returns all properties as as Map of key/value mappings.

        This method calls getAllProperties(SessionContext) with the current session's SessionContext object. See this method for more details.

        Returns:
        the key/value map of all non localized properties
      • getAllProperties

        public java.util.Map getAllProperties​(SessionContext ctx)
        Returns all properties as as Map of key/value mappings.

        This method is using the following attributes of the given SessionContext:

        CacheUsage   Language   StagingMethod
        yes   no   yes if used with staged items, no otherwise


        Parameters:
        ctx - a SessionContext object.
        Returns:
        the key/value map of all non localized properties
      • getPropertyNames

        public java.util.Set getPropertyNames()
        Returns all used property names (keys) of this item.

        This method calls getPropertyNames(SessionContext) with the current session's SessionContext object. See this method for more details.

        Returns:
        set of property names (Strings)
      • getPropertyNames

        public java.util.Set getPropertyNames​(SessionContext ctx)
        Returns all used property names (keys) of this item.

        This method is using the following attributes of the given SessionContext:

        CacheUsage   Language   StagingMethod
        yes   no   yes if used with staged items, no otherwise


        Parameters:
        ctx - A SessionContext object
        Returns:
        set of property names (Strings)
      • setProperty

        public java.lang.Object setProperty​(java.lang.String name,
                                            java.lang.Object value)
        Sets a Property.

        This method calls setProperty(SessionContext, String, Object) with the current session's SessionContext object. See this method for more details.

        Parameters:
        name - the name (key) of the property
        value - the value
        Returns:
        the property that was bound to the name or null if there was no property.
      • setProperty

        public java.lang.Object setProperty​(SessionContext ctx,
                                            java.lang.String name,
                                            java.lang.Object value)
        Sets a Property.

        This method is using the following attributes of the given SessionContext:

        CacheUsage   Language   StagingMethod
        no, this is a setter method.   no   yes if used with staged items, no otherwise


        Parameters:
        ctx - A SessionContext object
        name - the name (key) of the property
        value - the value
        Returns:
        the property that was bound to the name or null if there was no property.
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
        Gets a Property.

        This method calls getProperty(SessionContext, String) with the current session's SessionContext object. See this method for more details.

        Parameters:
        name - the name (key) of the property
        Returns:
        the value bound to the given name.
      • getProperty

        public java.lang.Object getProperty​(SessionContext ctx,
                                            java.lang.String name)
        Gets a Property.

        This method is using the following attributes of the given SessionContext:

        CacheUsage   Language   StagingMethod
        yes   no   yes if used with staged items, no otherwise


        Parameters:
        ctx - A SessionContext object
        name - the name (key) of the property
        Returns:
        the value bound to the given name.
      • removeProperty

        public java.lang.Object removeProperty​(java.lang.String name)
        Removes a Property.

        This method calls removeProperty(SessionContext, String) with the current session's SessionContext object. See this method for more details.

        Parameters:
        name - the name (key) of the property you want to remove
        Returns:
        the property that was bound to the name before removal or null if there was no property.
      • removeProperty

        public java.lang.Object removeProperty​(SessionContext ctx,
                                               java.lang.String name)
        Removes a Property.

        A call to this method is the same like setting a property to null.

        This method is using the following attributes of the given SessionContext:

        CacheUsage   Language   StagingMethod
        no, this is a setter method.   no   yes if used with staged items, no otherwise


        Parameters:
        ctx - A SessionContext object
        name - the name (key) of the property you want to remove
        Returns:
        the property that was bound to the name before removal or null if there was no property.
      • setAllProperties

        public void setAllProperties​(JaloPropertyContainer propertyContainer)
                              throws ConsistencyCheckException
        Set all properties in the property container, using the staging method set in the current session context.
        Parameters:
        propertyContainer - the property container
        Throws:
        ConsistencyCheckException - if the property container contains localized properties and the called item is not localizable
      • setAllProperties

        public void setAllProperties​(SessionContext ctx,
                                     JaloPropertyContainer propertyContainer)
                              throws ConsistencyCheckException
        Set all properties of the given property container.
        Parameters:
        ctx - determines the staging method, but not the localization of properties
        propertyContainer - the property container
        Throws:
        ConsistencyCheckException - if the property container contains localized properties and the called item is not localizable