Interface ContentTypeApiSupport<T extends ContentConvertible>

    • Method Detail

      • getExtensions

        Map<ContentId,​Map<String,​Object>> getExtensions​(Iterable<T> contentEntities,
                                                                    Expansions expansions)
        Get the set of extension properties for the collection of contentEntity Ids. Dealing with collections here may help reduce the number of db queries we need to execute.

        Implementors should override to provide extensions for the given contentEntity.

      • getLinks

        List<Link> getLinks​(T contentEntity)
        Get additional link properties for the _links map

        Implementors should override and provide links for the given contentEntity

      • getContainer

        @Deprecated
        default com.atlassian.fugue.Option<Object> getContainer​(T contentEntity,
                                                                Expansions expansions)
        Deprecated.
        The return type of this method is intentionally broad. Implementors can choose to return the commonly handled container hibernate entities, namely Space, Page or BlogPost, or can choose to provide a model object that implements the api Container interface, no further conversion of instances of Container objects will occur.
        Parameters:
        contentEntity - - the content entity to get the container object for
        Returns:
        either a Space, Page or BlogPost or an instance of Container
      • container

        Optional<Object> container​(T contentEntity,
                                   Expansions expansions)
        The return type of this method is intentionally broad. Implementors can choose to return the commonly handled container hibernate entities, namely Space, Page or BlogPost, or can choose to provide a model object that implements the api Container interface, no further conversion of instances of Container objects will occur.
        Parameters:
        contentEntity - - the content entity to get the container object for
        Returns:
        either a Space, Page or BlogPost or an instance of Container
        Since:
        7.0.1
      • getEntityClass

        Class<T> getEntityClass()
        Get the class of the hibernate object used to persist the content type handled by this api support
        Returns:
        the class of the entity used to persist changes
      • create

        T create​(Content content)
        Create a new persistent entity for the given api content
        Parameters:
        content - the model object to create a persistent entity for
        Returns:
        the newly created persistent entity
      • update

        T update​(Content content,
                 T existingEntity)
        Updates an existing persistent entity from the given api content
        Parameters:
        content - the updated content
        existingEntity - the existing entity
        Returns:
        the updated entity
      • validateCreate

        ValidationResult validateCreate​(Content newContent)
        Validate the create operation
        Parameters:
        newContent - the content that will be used to create an entity
        Returns:
        a validation result wrapping any validation errors that were encountered
      • validateUpdate

        ValidationResult validateUpdate​(Content oldContent,
                                        T existingEntity)
        Validate the update operation
        Parameters:
        oldContent - the content that will be used to update the entity
        existingEntity - the existing entity to be updated
        Returns:
        a validation result wrapping any validation errors that were encountered