public function onBeforeWrite()
    {
        $maps = array(
            /** URL Mapping */
            'TagAction',
            'TagsAction',
            'ShowAction',
            'AuthorAction',
            'ArchiveAction',
        );
        foreach ($maps as $map) {
            if ($this->owner->$map) {
                $this->owner->$map = singleton('SiteTree')->generateURLSegment($this->owner->$map);
            }
        }
        $newsFolder = Folder::find_or_make(Config::inst()->get($this->class, 'uploads_folder'));
        $this->owner->NewsRootFolderID = $newsFolder->ID;
    }