Interface TargetReference


public interface TargetReference
TargetReference is the persistence object of the reference editor (FS_REFERENCE).

Use the factory to create new instances.

Since:
4.2
  • Method Details

    • isEmpty

      @ApiDoc(comment="Tests if this TargetReference currently has no element set.", since="4.2") boolean isEmpty()
      Tests if this TargetReference currently has no element set.
      Returns:
      true if the TargetReference has no element set or false otherwise.
      Since:
      4.2
      See Also:
    • getLanguage

      @ApiDoc(comment="Get the language of the selected reference.", since="4.2") Language getLanguage()
      Get the language of the selected reference.
      Returns:
      the current language
      Since:
      4.2
    • getStoreType

      @ApiDoc(comment="Get the kind of Store.Type for the selected item.", since="4.2") Store.Type getStoreType()
      Get the kind of Store.Type for the selected item.
      Returns:
      the reference Store.Type
      Since:
      4.2
    • getUid

      @ApiDoc(comment="Retrieve the referenced element\'s unique id.", since="4.2") String getUid()
      Retrieve the referenced element's unique id.
      Returns:
      the referenced element IDProvider.getUid()
      Since:
      4.2
    • setUid

      @ApiDoc(comment="Set the Uid of the referenced element.", since="4.2") void setUid(String uid)
      Set the Uid of the referenced element.
      Parameters:
      uid - the referenced element IDProvider.getUid()
      Since:
      4.2
    • getUidType

      @ApiDoc(comment="Get the IDProvider.UidType of the given element.", since="4.2") IDProvider.UidType getUidType()
      Get the IDProvider.UidType of the given element.
      Returns:
      the referenced element IDProvider.getUidType()
      Since:
      4.2
    • setUidType

      @ApiDoc(comment="Set the IDProvider.UidType of the referenced element.", since="4.2") void setUidType(IDProvider.UidType type)
      Set the IDProvider.UidType of the referenced element.
      Parameters:
      type - the IDProvider.UidType to set for the referenced element.
      Since:
      4.2
    • get

      @ApiDoc(comment="Get the reference of the element currently set in this TargetReference.", since="4.2") @Nullable @Nullable IDProvider get()
      Get the reference of the element currently set in this TargetReference. Given element should always be a type of IDProvider.
      Returns:
      the referenced IDProvider element
      Since:
      4.2
    • set

      @ApiDoc(comment="Set a new element reference of type IDProvider and infer settings for UID and UidType.", since="4.2") void set(IDProvider reference)
      Set a new element reference of type IDProvider and infer settings for UID and UidType.
      Parameters:
      reference - the IDProvider to set
      Since:
      4.2
    • resetTo

      @ApiDoc(comment="Reset the reference and the remote information and infer settings for UID and UidType.", since="4.2.202") void resetTo(IDProvider reference, @Nullable @Nullable String remote)
      Reset the reference and the remote information and infer settings for UID and UidType.
      Parameters:
      reference - The reference to be set and inferred from.
      remote - The symbolic remote project name.
      Since:
      4.2.202
    • getRemoteSymName

      @ApiDoc(comment="Return the symbolic remote project name set in the local remote project configuration.", since="4.2") @Nullable @Nullable String getRemoteSymName()
      Return the symbolic remote project name set in the local remote project configuration.
      Returns:
      the remote project symbolic name
      Since:
      4.2
      See Also:
    • setRemoteSymName

      @ApiDoc(comment="If the set element is a remote project reference, this method set the symbolic remote project name definied in the local project configuration.", since="4.2") void setRemoteSymName(@Nullable @Nullable String remoteProjectSymName)
      If the set element is a remote project reference, this method set the symbolic remote project name definied in the local project configuration.
      Parameters:
      remoteProjectSymName - the name to set
      Since:
      4.2
    • getSection

      @ApiDoc(comment="Get the referenced section.", since="4.2") @Nullable @Nullable Section<?> getSection()
      Get the referenced section.

      NOTE: This method is broken for reference gadgets operating in section only mode, where it always returns null. The way here is to use the known page element and the section name with loadSection(Page, String) to resolve the according section element.

      Returns:
      the section or null if reference is not type of Section
      Since:
      4.2
    • setSection

      @ApiDoc(comment="Set the section to be referenced.", since="4.2") void setSection(@Nullable @Nullable Section<?> section)
      Set the section to be referenced.
      Parameters:
      section -
      Since:
      4.2
    • loadSection

      @ApiDoc(comment="Load a section of the given referenced page identified by its section name.", since="4.2") @Nullable @Nullable Section<?> loadSection(@NotNull @NotNull Page page, String sectionName)
      Load a section of the given referenced page identified by its section name.
      Parameters:
      page - The reference to the section's page.
      sectionName - The name of the section.
      Returns:
      The section or null.
      Since:
      4.2
    • setSectionName

      @ApiDoc(comment="Use this to set the section.", since="4.2") void setSectionName(@Nullable @Nullable String name)
      Use this to set the section. The section object will be loaded internally from the sectionName.
      Parameters:
      name - Section.getName()
      Since:
      4.2
    • getSectionName

      @ApiDoc(comment="Return the name of the Section if the referenced element is of type Section.", since="4.2") String getSectionName()
      Return the name of the Section if the referenced element is of type Section.
      Returns:
      the section name
      Since:
      4.2
    • getPageRef

      @ApiDoc(comment="Returns a set page reference or null if referenced element is not type of PageRef.", since="4.2") @Nullable @Nullable PageRef getPageRef()
      Returns a set page reference or null if referenced element is not type of PageRef.
      Returns:
      the PageRef or null.
      Since:
      4.2
    • getPage

      @ApiDoc(comment="Returns a set page or null if referenced element is not type of Page.", since="4.2") @Nullable @Nullable Page getPage()
      Returns a set page or null if referenced element is not type of Page. Also returns the page of a section, referenced by this element.
      Returns:
      the Page or null.
      Since:
      4.2
    • getMedia

      @ApiDoc(comment="Returns a set medium if any or null if reference is not a type of Media.", since="4.2") @Nullable @Nullable Media getMedia()
      Returns a set medium if any or null if reference is not a type of Media.
      Returns:
      the referenced media or null.
      Since:
      4.2
    • getContent

      @ApiDoc(comment="Returns a Content2 reference or null if reference is not a type of Content2.", since="4.2") @Nullable @Nullable Content2 getContent()
      Returns a Content2 reference or null if reference is not a type of Content2.
      Returns:
      the referenced content2 element or null.
      Since:
      4.2
    • getDocumentGroup

      @ApiDoc(comment="Returns a DocumentGroup reference or null if the referenced instance is not a DocumentGroup.", since="4.2.17") @Nullable @Nullable DocumentGroup getDocumentGroup()
      Returns a DocumentGroup reference or null if the referenced instance is not a DocumentGroup.
      Returns:
      the referenced document group
      Since:
      4.2.17