Interface MetadataManager


  • public interface MetadataManager
    • Method Detail

      • saveMetadataSet

        void saveMetadataSet​(MetadataSet metadataset)
        Save metadata set.
        Parameters:
        metadataset - the metadataset
      • loadMetadataSet

        MetadataSet loadMetadataSet​(long id)
        Load metadata set.
        Parameters:
        id - the id
        Returns:
        the metadata set
      • removeMetadataSet

        void removeMetadataSet​(MetadataSet metadataSet)
        Removes the metadata set.
        Parameters:
        metadataSet - the metadata set
      • loadMetadataSets

        List<MetadataSet> loadMetadataSets​(String spaceKey)
        Load metadata sets.
        Parameters:
        spaceKey - the space key. If NULL it searches for global sets.
        Returns:
        the list
      • loadMetadataSets

        List<MetadataSet> loadMetadataSets()
        Load metadata sets.
        Returns:
        the list
      • loadMetadataField

        MetadataField loadMetadataField​(long id)
        Load metadata field.
        Parameters:
        id - the id
        Returns:
        the metadata field
      • loadMetadataFields

        List<MetadataField> loadMetadataFields​(String spaceKey)
        Load metadata fields.
        Parameters:
        spaceKey - the space key. If NULL it searches for global fields.
        Returns:
        the list
      • loadMetadataFields

        List<MetadataField> loadMetadataFields()
        Load metadata all fields (global and spacelokal).
        Returns:
        the list
      • removeMetadataField

        void removeMetadataField​(MetadataField metadataField)
        Removes the metadata field.
        Parameters:
        metadataField - the metadata field
      • saveMetadataField

        MetadataField saveMetadataField​(MetadataField metadata)
        Save metadata field.
        Parameters:
        metadata - the metadata
        Returns:
        the metadata field
      • loadContentMetadataSets

        Map<com.atlassian.confluence.core.ContentEntityObject,​List<MetadataSet>> loadContentMetadataSets​(com.atlassian.confluence.core.ContentEntityObject... ceos)
        Load content metadata sets. Use this method when reading large amounts of data.
        Parameters:
        ceos - list of ContentEntityObjects
        Returns:
        the map of ContentEntityObjects and metadata set ids
      • loadContentMetadataSets

        List<MetadataSet> loadContentMetadataSets​(com.atlassian.confluence.core.ContentEntityObject ceo)
        Load content metadata sets.
        Parameters:
        ceo - the ceo
        Returns:
        the list
      • loadContentMetadataValue

        DataObject loadContentMetadataValue​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                            MetadataField field)
        Load content metadata value.
        Parameters:
        ceo - the ceo
        field - the field
        Returns:
        the data object
      • saveContentMetadataValue

        void saveContentMetadataValue​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                      MetadataField metadataField,
                                      DataObject metadataValue)
                               throws MetadataException
        Save content metadata value.
        Parameters:
        ceo - the ceo
        metadataField - the metadata field
        metadataValue - the metadata value
        Throws:
        MetadataException - the metadata exception
      • saveContentMetadataSet

        void saveContentMetadataSet​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                    MetadataSet metadataSet)
                             throws MetadataException
        Save content metadata set.
        Parameters:
        ceo - the ceo
        metadataSet - the metadata set
        Throws:
        MetadataException - the metadata exception
      • removeContentMetadataSet

        void removeContentMetadataSet​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                      MetadataSet metadataSet)
        Removes the content metadata set.
        Parameters:
        ceo - the ceo
        metadataSet - the metadata set
      • removeContentMetadataField

        boolean removeContentMetadataField​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                           MetadataField metadataField)
        Removes the content metadata field.
        Parameters:
        ceo - the ceo
        metadataField - the metadata field
        Returns:
        true, if successful
      • loadContentMetadataValues

        Map<MetadataField,​DataObject> loadContentMetadataValues​(com.atlassian.confluence.core.ContentEntityObject contentObject,
                                                                      MetadataSet metadataSet)
        Load content metadata values.
        Parameters:
        contentObject - the content object
        metadataSet - the metadata set
        Returns:
        the map
      • saveContentHistoryEntry

        void saveContentHistoryEntry​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                     MetadataContentHistoryEntry metadataContentHistoryEntry)
        Save content history entry.
        Parameters:
        ceo - the ceo
        metadataContentHistoryEntry - the metadata content history entry
      • loadContentHistoryEntries

        List<MetadataContentHistoryEntry> loadContentHistoryEntries​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                                                    int count,
                                                                    int offset)
        Load content history entries.
        Parameters:
        ceo - the ceo
        count - the count
        offset - the offset
        Returns:
        the list
      • loadContentHistoryEntries

        List<MetadataContentHistoryEntry> loadContentHistoryEntries​(long timestampSince)
        Load content history entries.
        Parameters:
        timestampSince - all historyentries from this timestamp up will be returned
        Returns:
        the list of historyentries
      • loadMetadataFieldByKey

        MetadataField loadMetadataFieldByKey​(String key,
                                             com.atlassian.confluence.spaces.Space space)
        Load metadata field by key.
        Parameters:
        key - the key
        space - the space. If NULL it searches for global fields.
        Returns:
        the metadata field
      • loadMetadataSetByKey

        MetadataSet loadMetadataSetByKey​(String key,
                                         com.atlassian.confluence.spaces.Space space)
        Load metadata set by key.
        Parameters:
        key - the key
        space - the space. If NULL it searches for global sets.
        Returns:
        the metadata set
      • removeContentMetadata

        void removeContentMetadata​(com.atlassian.confluence.core.ContentEntityObject ceo)
        Removes the content metadata.
        Parameters:
        ceo - the ceo
      • saveContentMetadataValue

        void saveContentMetadataValue​(com.atlassian.confluence.core.ContentEntityObject entity,
                                      MetadataField metadataField,
                                      com.atlassian.confluence.user.ConfluenceUser userForJob,
                                      DataObject value)
                               throws MetadataException
        Save content metadata value.
        Parameters:
        entity - the entity
        metadataField - the metadata field
        userForJob - the user for job
        value - the value
        Throws:
        MetadataException - the metadata exception
      • loadMetadatSetsForField

        List<MetadataSet> loadMetadatSetsForField​(MetadataField metadataField)
        Load metadat sets for field.
        Parameters:
        metadataField - the metadata field
        Returns:
        the list
      • removeContentMetadataField

        boolean removeContentMetadataField​(com.atlassian.confluence.core.ContentEntityObject ceo,
                                           MetadataSet newSet,
                                           MetadataField fieldToDelete)
        Remove a field from content object. The field only gets deleted if no other set hold the same field
        Parameters:
        ceo - the ceo
        newSet - the new set
        fieldToDelete - the field to delete
        Returns:
        true, if successful
      • hasMetadataSet

        boolean hasMetadataSet​(com.atlassian.confluence.core.ContentEntityObject ceo)
        This method tells if the given entity object has any metadataset attached to it.
        Parameters:
        ceo - the content entity object
        Returns:
        true if it has a metadata set attached, false if it doesn't