Package nl.gx.webmanager.cms.core
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceEntity
getResourceEntity()
ResourceInstance
getResourceInstance()
void
setResourceInstance(ResourceInstance resourceInstance)
Sets the resource instance to link to.-
Methods inherited from interface nl.gx.webmanager.cms.core.RelatedLink
getCode, getCustomTitle, getEditLink, getLink, getLink, getLink, getLink, getLink, getLinkModel, getPopUpProperties, getPopUpProperties, getSuffix, getTarget, getTarget, getTitle, getTitleOption, setCode, setCustomTitle, setLinkModel, setSuffix, setTitleOption
-
-
-
-
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
-
-