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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classTargetReference factory methods. -
Method Summary
Modifier and TypeMethodDescription@Nullable IDProviderget()Get the reference of the element currently set in this TargetReference.@Nullable Content2@Nullable DocumentGroupGet the language of the selected reference.@Nullable MediagetMedia()Returns a set medium if any ornullif reference is not a type ofMedia.@Nullable PagegetPage()Returns a set page or null if referenced element is not type ofPage.@Nullable PageRefReturns a set page reference ornullif referenced element is not type ofPageRef.@Nullable StringReturn the symbolic remote project name set in the local remote project configuration.@Nullable Section<?>Get the referenced section.Return the name of theSectionif the referenced element is of type Section.Get the kind ofStore.Typefor the selected item.getUid()Retrieve the referenced element's unique id.Get theIDProvider.UidTypeof the given element.booleanisEmpty()Tests if thisTargetReferencecurrently has no element set.@Nullable Section<?>loadSection(@NotNull Page page, String sectionName) Load a section of the given referenced page identified by its section name.voidresetTo(IDProvider reference, @Nullable String remote) Reset the reference and the remote information and infer settings for UID and UidType.voidset(IDProvider reference) Set a new element reference of typeIDProviderand infer settings for UID and UidType.voidsetRemoteSymName(@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.voidsetSection(@Nullable Section<?> section) Set the section to be referenced.voidsetSectionName(@Nullable String name) Use this to set the section.voidSet the Uid of the referenced element.voidsetUidType(IDProvider.UidType type) Set theIDProvider.UidTypeof the referenced element.
-
Method Details
-
isEmpty
@ApiDoc(comment="Tests if this TargetReference currently has no element set.", since="4.2") boolean isEmpty()Tests if thisTargetReferencecurrently has no element set.- Returns:
trueif the TargetReference has no element set orfalseotherwise.- Since:
- 4.2
- See Also:
-
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 ofStore.Typefor the selected item.- Returns:
- the reference
Store.Type - Since:
- 4.2
-
getUid
Retrieve the referenced element's unique id.- Returns:
- the referenced element
IDProvider.getUid() - Since:
- 4.2
-
setUid
Set the Uid of the referenced element.- Parameters:
uid- the referenced elementIDProvider.getUid()- Since:
- 4.2
-
getUidType
@ApiDoc(comment="Get the IDProvider.UidType of the given element.", since="4.2") IDProvider.UidType getUidType()Get theIDProvider.UidTypeof 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 theIDProvider.UidTypeof the referenced element.- Parameters:
type- theIDProvider.UidTypeto 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 ofIDProvider.- Returns:
- the referenced
IDProviderelement - 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 typeIDProviderand infer settings for UID and UidType.- Parameters:
reference- theIDProviderto 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 thesection namewithloadSection(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 theSectionif 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 ornullif referenced element is not type ofPageRef.- 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 ofPage. 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 ornullif reference is not a type ofMedia.- 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:
- 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:
- the referenced document group
- Since:
- 4.2.17
-