public function getLink()
    {
        $urlSegment = sprintf('%d-%s', $this->ID, URLSegmentFilter::create()->filter($this->getTitle()));
        $result = Controller::join_links(Director::baseURL(), 'dmsdocument/' . $urlSegment);
        if (!$this->canView()) {
            $result = sprintf("javascript:alert('%s')", $this->getPermissionDeniedReason());
        }

        $this->extend('updateGetLink', $result);

        return $result;
    }
public function getLink()
    {
        $urlSegment = sprintf('%d-%s', $this->ID, URLSegmentFilter::create()->filter($this->getTitle()));
        $result = Controller::join_links(Director::baseURL(), 'dmsdocument/' . $urlSegment);
        if (!$this->canView()) {
            $result = sprintf("javascript:alert('%s')", $this->getPermissionDeniedReason());
        }

        $this->extend('updateGetLink', $result);

        return $result;
    }
public function getLink ( ) { $ urlSegment = sprintf ( '%d-%s' , $ this -> ID , URLSegmentFilter :: create ( ) -> filter ( $ this -> getTitle ( ) ) ) ; $ result = Controller :: join_links ( Director :: baseURL ( ) , 'dmsdocument/' . $ urlSegment ) ; if ( ! $ this -> canView ( ) ) { $ result = sprintf ( "javascript:alert('%s')" , $ this -> getPermissionDeniedReason ( ) ) ; } $ this -> extend ( 'updateGetLink' , $ result ) ; return $ result ; }
Returns a link to download this document from the DMS store.
Alternatively a basic javascript alert will be shown should the user not have view permissions. An extension
point for this was also added.

To extend use the following from within an Extension subclass:

<code>
public function updateGetLink($result)
{
// Do something here
}
</code>

@return string
Returns a link to download this document from the DMS store . Alternatively a basic javascript alert will be shown should the user not have view permissions . An extension point for this was also added .