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
 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, getEditLink, getLink, getLink, getLinkModel, getPopUpProperties, getTarget, setCode, setLinkModel
 
Methods inherited from interface nl.gx.webmanager.wrapper.Wrapper
getId, getUUID, setId, setUUID
 

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


Copyright © 2007-2011 GX Software BV. All Rights Reserved.