Interface RelatedResourceLink

  • All Superinterfaces:
    RelatedLink, Wrapper

    public interface RelatedResourceLink
    extends RelatedLink
    Currently does not add its own methods but you can still use the type to distinguish between different kind of RelatedLinks.
    See Also:
    RelatedLink
    • Method Detail

      • getResourceEntity

        ResourceEntity getResourceEntity()
        Returns:
        the entity this related link points to (usually a database page).
      • getResourceInstance

        ResourceInstance getResourceInstance()
        Returns:
        the resource instance.
      • setResourceInstance

        void setResourceInstance​(ResourceInstance resourceInstance)
        Sets the resource instance to link to. Integer myDbId = 1; RelatedResourceLink relatedResourceLink; // Assume an existing link object ResourceEntity[] entities = website.getResourceEntities(); ResourceEntity refEntity = null; for (ResourceEntity entity : entities) { if ("myDatabaseTypeValue".equals(entity.getIdentifier())) { refEntity = entity; } } ResourceInstance resourceInstance = (ResourceInstance) session.getWrapper(myDbId, ResourceInstance.class); if (resourceInstance != null && refEntity != null) { resourceInstance.setResourceEntity(refEntity); relatedResourceLink.setResourceInstance(resourceInstance); }
        Parameters:
        resourceInstance - the resourceInstance to link to