Interface ModelObject

All Superinterfaces:
CanRender<Renderer<? extends Renderer<?>>>, HasFields, HasReference<ModelEntityReference>, ModelEntity
All Known Subinterfaces:
Baseline, BaselineCollection, Category, Document, ModelObjectBase<T,R>, Plan, Project, RichPage, Script, TestRun, TimePoint, UpdatableBaseline, UpdatableBaselineCollection, UpdatableCategory, UpdatableDocument, UpdatableModelObject, UpdatableModelObjectBase<T,R>, UpdatablePlan, UpdatableProject, UpdatableRichPage, UpdatableScript, UpdatableTestRun, UpdatableTimePoint, UpdatableUser, UpdatableUserGroup, UpdatableWikiPage, UpdatableWorkItem, User, UserGroup, WikiPage, WorkItem

public interface ModelObject extends ModelEntity, HasFields
Since:
3.9.0
  • Method Details

    • getReference

      @NotNull ModelObjectReference getReference()
      Returns a reference including the requested and actual revisions.
      Specified by:
      getReference in interface HasReference<ModelEntityReference>
    • getReferenceToCurrent

      @NotNull ModelObjectReference getReferenceToCurrent()
      Returns a reference to the current (latest) revision of this object, which means that it has always null requested revision, even if this object was requested from some revision.

      This method should be used to obtain the current reference of an object, as it correctly reflects the object's current location, even if it has been renamed or moved since the reference was last obtained.

      This method must be used over ModelObjectReference.getWithRevision(String) with null, or ModelObjectReference.getCurrent(), both of which retain the path stored in the reference and do not account for renames or moves.

    • getUpdatable

      @NotNull UpdatableModelObject getUpdatable(@NotNull WriteTransaction transaction)
    • getFromRevision

      @NotNull ModelObject getFromRevision(@Nullable String revision)
      Returns the object from a specified revision. This method will correctly resolve renamed/moved objects. If the revision is null, it returns the latest object.

      Parameters:
      revision - the revision from which to get the object, or null for the current revision.
      Returns:
      the object at the specified revision.
      Since:
      3.26.6
    • history

      @NotNull IterableWithSize<? extends ModelObjectReference> history()
      Returns history of object. If object is versioned (has requested revision) then history up to this revision will be returned. The history list is sorted from the oldest (coming first) to the newest (last).
    • fields

      @NotNull Fields fields()
      Specified by:
      fields in interface HasFields
    • resolve

      void resolve()
    • forget

      void forget()
    • can

      @NotNull ModelObjectPermissions can()
      Specified by:
      can in interface ModelEntity
      Since:
      3.9.1
    • getOldApi

      @NotNull @GwtIncompatible com.polarion.platform.persistence.model.IPObject getOldApi()
    • label

      @NotNull String label()
      Returns some non empty user friendly label of the object. It does not throw exception when the object is unresolvable or user has no permission to read it, but instead just returns the id.
      Since:
      3.9.2
    • copyFieldsTo

      @NotNull CopyCommand copyFieldsTo(@NotNull UpdatableModelObject target)
      Returns:
      CopyCommand for setting and executing copy action
      Since:
      3.10.0