Interface IDProvider

All Superinterfaces:
Comparable<StoreElement>, HistoryProvider, StoreElement, Workflowable
All Known Subinterfaces:
Body, ChannelSourceProvider, Content2, Content2Section, ContentFolder, ContentProducer, ContentStoreRoot, DataProvider, Dataset, DocumentGroup, FormatTemplate, FormatTemplateContainer, FormatTemplateFolder, FormatTemplates, GCABody, GCAFolder, GCAPage, GCASection, GlobalContentArea, GlobalStoreRoot, GomSourceProvider, LinkTemplate, LinkTemplates, MasterTemplate, Media, MediaFolder, MediaStoreRoot, PackagePoolItem, Page, PageFolder, PageRef, PageRefFolder, PageStoreRoot, PageTemplate, PageTemplates, Previewable, PreviewImageProvider, ProjectProperties, Query, Referenceable, Schema, SchemaContainer, SchemaFolder, Schemes, Script, ScriptContainer, ScriptFolder, Scripts, Section<T>, SectionReference<T>, SectionTemplate, SectionTemplates, SiteStoreFolder, SiteStoreRoot, StartNode, Store, StyleTemplate, TableFormatTemplate, TableTemplate, Template, TemplateContainer<T>, TemplateContentProvider, TemplateFolder<T>, TemplateProvider<T>, TemplateStoreElement, TemplateStoreRoot, URLProperties, UserProperties, Workflow, WorkflowContainer, WorkflowFolder, Workflows

public interface IDProvider extends StoreElement, HistoryProvider
Since:
3.0.9
  • Field Details

  • Method Details

    • getId

      @ApiDoc(comment="Returns the unique ID of this IDProvider", since="4.0.90") long getId()
      Returns the unique ID of this IDProvider
      Returns:
      the unique ID of this IDProvider
      Since:
      4.0.90
    • getLongID

      @ApiDoc(comment="", since="3.1") Long getLongID()
      Since:
      3.1
    • getRevision

      @ApiDoc(comment="", since="4.0") Revision getRevision()
      Since:
      4.0
    • getReleaseRevision

      @ApiDoc(comment="", since="4.0") @Nullable @Nullable Revision getReleaseRevision()
      Since:
      4.0
    • getInRevision

      @ApiDoc(comment="Get this element in the state of the given revision.", since="4.0.52") @Nullable @Nullable IDProvider getInRevision(@NotNull @NotNull Revision revision)
      Get this element in the state of the given revision. If the provided revision is older than Project#getFirstCompleteRevision() this method may behave unexpectly, i.e. may throw an exception or return null.
      Parameters:
      revision - The revision to use.
      Returns:
      The revision-based element.
      Since:
      4.0.52
    • getUid

      @ApiDoc(comment="Returns the unique identifier of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!", since="4.0") @NotNull @NotNull String getUid()
      Returns the unique identifier of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!
      Returns:
      unique identifier
      Since:
      4.0
      See Also:
    • setUid

      @ApiDoc(comment="Sets the unique identifier.", since="4.0") void setUid(@NotNull @NotNull String uid)
      Sets the unique identifier. The provided uid should contain only lower case characters.

      Attention: Use with care. Changing the unique identifier will destroy all incoming references which use this unique identifier.


      If the given unique identifier isn't unique on the server during StoreElement.save() a DuplicateReferenceNameException will be thrown
      Parameters:
      uid - new unique identifier; should contain only lower case characters - internally this value is transformed to lower case
      Throws:
      NullPointerException - if the provided uid is null
      Since:
      4.0
    • getUidType

      @ApiDoc(comment="Returns the unique identifier type of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!", since="4.0") @NotNull @NotNull IDProvider.UidType getUidType()
      Returns the unique identifier type of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!
      Returns:
      the unique identifier
      Since:
      4.0
      See Also:
    • hasUid

      @ApiDoc(comment="Returns true if this IDProvider has a unique identifier like e.g. medias, false otherwise.", since="4.0") boolean hasUid()
      Returns true if this IDProvider has a unique identifier like e.g. medias, false otherwise. This method must be called in prior to getUid() and getUidType()!
      Returns:
      true if this IDProvider has a unique identifier, false otherwise
      Since:
      4.0
      See Also:
    • getLanguageInfo

      @ApiDoc(comment="Returns the LanguageInfo node for the given language", since="4.0") LanguageInfo getLanguageInfo(@NotNull @NotNull Language language)
      Returns the LanguageInfo node for the given language
      Parameters:
      language - the language to get the language specific info node for
      Returns:
      LanguageInfo node for the given language
      Since:
      4.0
    • moveChild

      @ApiDoc(comment="Insert child at last position.", since="4.0") void moveChild(IDProvider child) throws LockException, ElementMovedException
      Insert child at last position. This method requires no lock! The given child can be a child of a different parent. Calls moveChild(child, -1)
      Parameters:
      child - the child to be moved
      Throws:
      LockException
      ElementMovedException
      Since:
      4.0
    • moveChild

      @ApiDoc(comment="Insert child at index position.", since="4.0") void moveChild(IDProvider child, int nextSiblingIndex) throws LockException, ElementMovedException
      Insert child at index position. This method requires no lock! The given child can be a child of a different parent. The provided index should be the index of an IDProvider child node (if not the child is moved to the last index).

      Example: Move from another parent

       Root
        |-- newParent
        |     |-- firstNode
        |     `-- nextSibling
        `-- oldParent
              `-- moveNode
       try {
           // move 'moveNode' to 'newParent', position before 'nextSibling'
           newParent.moveChild(moveNode, newParent.getChildIndex(nextSibling));
       } catch(ElementMovedException e) {
          // element moveNode already moved on the server
       } catch(LockException e) {
          // one of the elements (newParent, oldParent, moveNode) is locked on the server by another user
       }
       
      Parameters:
      child - the child to be moved to this element
      nextSiblingIndex - the index of the next sibling. The given child will be positioned before next sibling.
      Throws:
      LockException
      ElementMovedException
      Since:
      4.0
      See Also:
    • getDisplayName

      @ApiDoc(comment="Return the display name (label) for the specified language - if no language specific label is defined for this language the value for the master language is returned.", since="4.0.13") @NotNull @NotNull String getDisplayName(Language language)
      Return the display name (label) for the specified language - if no language specific label is defined for this language the value for the master language is returned. If this is also not set a node dependent fallback value is returned.
      Since:
      4.0.13
    • setDisplayName

      @ApiDoc(comment="Sets the display name (label) for the specified language.", since="5.1.205") void setDisplayName(@NotNull @NotNull Language language, @Nullable @Nullable String displayName)
      Sets the display name (label) for the specified language. If the given language is the master language of the project, the display name will also become the default display name for other languages, where no name is set explicitly.
      Parameters:
      language - The language to set the display name for.
      displayName - The display name to be set.
      Since:
      5.1.205
    • isReleaseSupported

      @ApiDoc(comment="Indicates wether this element supports release or not.", since="4.1.9") boolean isReleaseSupported()
      Indicates wether this element supports release(boolean) or not.
      Returns:
      true if this element supports release, false otherwise
      Since:
      4.1.9
      See Also:
    • getReleaseStatus

      @ApiDoc(comment="Returns the release state of this storeelement (CHANGED or RELEASED or NEVER_RELEASED)", since="4.0.13") int getReleaseStatus()
      Returns the release state of this storeelement (CHANGED or RELEASED or NEVER_RELEASED)
      Since:
      4.0.13
      See Also:
    • isReleased

      @ApiDoc(comment="Returns true if this element is currently released (not changed).", since="5.0.414") boolean isReleased()
      Returns true if this element is currently released (not changed). Semantically the same as (getReleaseStatus() == RELEASED) but probably faster, at least for datasets
      Since:
      5.0.414
    • getReleasedBy

      @ApiDoc(comment="The last user who released this node or null if this node has never been released.", since="4.1.9") @Nullable @Nullable User getReleasedBy()
      The last user who released this node or null if this node has never been released. In projects which do not use the release feature this method returns the last editor.
      Since:
      4.1.9
    • isInReleaseStore

      @ApiDoc(comment="Checks if this storeelement exists in the release representation of the belonging store.", since="4.1.9") boolean isInReleaseStore()
      Checks if this storeelement exists in the release representation of the belonging store. This method could only be called for storeelements which support release and which are in the current representation of the belonging store
      Returns:
      true if the node exists in the release store, false otherwise
      Since:
      4.1.9
      See Also:
    • release

      @ApiDoc(comment="Release this node and all childs.", since="4.1.9") void release()
      Release this node and all childs.
      Since:
      4.1.9
    • release

      @ApiDoc(comment="Release this node and optionally all childs", since="4.0") void release(boolean releaseChilds)
      Release this node and optionally all childs
      Since:
      4.0
    • getParent

      @ApiDoc(comment="Return parent IDProvider which is null for deleted elements or store-roots.", since="4.0.17") @Nullable @Nullable IDProvider getParent()
      Return parent IDProvider which is null for deleted elements or store-roots.
      Specified by:
      getParent in interface StoreElement
      Returns:
      parent IDProvider which is null for deleted elements or store-roots.
      Since:
      4.0.17
    • contrastWith

      @ApiDoc(comment="Contrast the element with another one.", since="4.0.52") @NotNull @NotNull Set<de.espirit.firstspirit.storage.Contrast> contrastWith(IDProvider reference)
      Contrast the element with another one. Returns the set of changes being applied from the reference element to this one.
      Parameters:
      reference - The reference element.
      Returns:
      A set of change information.
      Since:
      4.0.52
    • revert

      @ApiDoc(comment="Reverts this store element to the given FSRevision.", since="4.0.44") void revert(@NotNull @NotNull Revision revision, boolean recursive, @NotNull @NotNull EnumSet<IDProvider.RevertType> ignoreRevertTypes) throws LockException
      Reverts this store element to the given FSRevision. The element does not need to be locked for this operation, since it is going to be locked and unlocked automatically by this method.
      Parameters:
      revision - the revision to revert to, must not be null.
      recursive - indicates if child elements should be reverted, too.
      ignoreRevertTypes -
      Throws:
      LockException - if it was not possible to lock this element.
      Since:
      4.0.44
      See Also:
    • getMeta

      @Deprecated @Nullable @Nullable Data getMeta()
      Deprecated.
      since 4.2.450 - use getMetaFormData() instead
      Returns the meta data for this element or null if there is no meta data template defined for project.
      Returns:
      The meta data or null if there is no meta data template defined for project.
      Since:
      4.0.54
      See Also:
    • setMeta

      @Deprecated void setMeta(@Nullable @Nullable Data data)
      Deprecated.
      Set meta data for this element or provide null to remove meta data.
      Parameters:
      data - The meta data to be set.
      Since:
      4.0.54
    • hasMeta

      @ApiDoc(comment="Indicates that any meta data is set for this element.", since="4.0.120") boolean hasMeta()
      Indicates that any meta data is set for this element.
      Returns:
      true, if any meta data is set.
      Since:
      4.0.120
    • getMetaFormData

      @ApiDoc(comment="Returns the formdata container of this element or null if there is no meta data template defined for project.", since="4.2.450") @Nullable @Nullable FormData getMetaFormData()
      Returns the formdata container of this element or null if there is no meta data template defined for project.
      Returns:
      the formdata container of this element or null if there is no meta data template defined for project.
      Since:
      4.2.450
      See Also:
    • setMetaFormData

      @ApiDoc(comment="Sets the given formdata container of this element. Removes meta data if null is provided.", since="4.2.450") void setMetaFormData(@Nullable @Nullable FormData formData)
      Sets the given formdata container of this element. Removes meta data if null is provided.
      Parameters:
      formData - the form data container to be set to this element or null to remove meta data.
      Since:
      4.2.450