Prototype Story
ACTIONS | FUNCTIONS | MACROS | SKINS | TEMPLATES | TYPE.PROPERTIES

Actions
comment_action
comment action
delete_action
delete action
edit_action
edit action
main_action
main action
 
Functions
allowTextMacros(s)
function explicitly allowes some macros for use in the text of a story
checkAccess(action, usr, level)
permission check (called by hopobject.onRequest())
checkDelete(usr, level)
check if user is allowed to delete a story
checkEdit(usr, level)
check if user is allowed to edit a story
checkPost(usr, level)
check if user is allowed to post a comment to this story
checkView(usr, level)
check if user is allowed to view story
constructor(creator, ipaddress)
constructor function for story objects
deleteAll()
function deletes all childobjects of a story (recursive!)
deleteComment(commentObj)
function deletes a whole thread
evalComment(param, creator)
function evaluates comment and adds it if ok
evalStory(param, modifier)
check if story is ok; if true, save changed story
getNavigationName()
Return either the title of the story or the id prefixed with standard display name to be used in the global linkedpath macro
getRenderedContentPart(name, fmt)
function checks if the text of the story was already cached and if it's still valid if false, it caches it again
incrementReadCounter()
function records the access to a story-object by incrementing the counter of the Object representing this story in app.data.readLog which will be stored in database by scheduler
setContent(newContent)
Sets this text's content to a new content object. This should be used instead of this.content.setAll() to make sure also set the rawcontent property is set.
toggleOnline(newStatus)
function sets story either online or offline
 
Macros
Story.addtofront
macro renders a checkbox whether the story is published on the site's front page
Story.backlinks
macro returns a list of references linking to a story since referrers are asynchronously written to database by scheduler it makes sense to cache them in story.cache.rBacklinks because they won't c ...
Story.commentcounter
macro renders number of comments options: text to use when no comment text to use when one comment text to use when more than one comment action to link to (default: main)
Story.commentform
macro checks if user is logged in and not blocked if true, render form to add a comment
Story.commentlink
macro rendering link to comments
Story.comments
macro loops over comments and renders them
Story.content
macro for rendering a part of the story content
Story.createtime
macro rendering createtime of story, either as editor, plain text or as link to the frontpage of the day
Story.deletelink
macro rendering a link to delete if user is creator of this story
Story.discussions
macro renders a checkbox for enabling/disabling discussions for backwards compatibility this macro also renders a hidden input so that we can check if the checkbox is embedded in story/edit.skin
Story.editableby
macro renders the property of story that defines if other users may edit this story
Story.editlink
macro rendering a link to edit if user is allowed to edit
Story.location
macro rendering the location of the story
Story.online
macro rendering online status of story
Story.onlinelink
macro renders a link to toggle the online-status of this story
Story.topic
macro renders the name of the topic this story belongs to either as link, image (if an image entiteld by the topic name is available) or plain text
Story.topicchooser
macro renders a list of existing topics as dropdown
Story.viewlink
macro renders a link to the story
 
Skins
backlinkItem.skin
param.count, param.referrer, param.text
backlinks.skin
param.referrers
comment.skin
dayheader.skin
display.skin
edit.skin
request.topic, response.action
embed.skin
historyview.skin
main.skin
mgrlistitem.skin
mostread.skin
param.rank, param.reads
preview.skin
rssItem.skin
param.creator, param.date, param.email, param.publisher, param.subject, param.text, param.title, param.url, param.year
rssResource.skin
searchview.skin
 


type.properties
_db = antville
_table = AV_TEXT
_parent = site.stories
_id = TEXT_ID
_prototype = TEXT_PROTOTYPE

##
## object references
##
site              = object(Site)
site.local        = TEXT_F_SITE
site.foreign      = SITE_ID

story             = object(Story)
story.local       = TEXT_F_TEXT_STORY
story.foreign     = TEXT_ID

parent            = object(Comment)
parent.local      = TEXT_F_TEXT_PARENT
parent.foreign    = TEXT_ID

creator           = object(User)
creator.local     = TEXT_F_USER_CREATOR
creator.foreign   = USER_ID

modifier          = object(User)
modifier.local    = TEXT_F_USER_MODIFIER
modifier.foreign  = USER_ID

##
## xml encoded properties
##
content     = mountpoint(PropertyMgr)
content_xml = TEXT_CONTENT

##
## primitive properties
##
day            = TEXT_DAY
topic          = TEXT_TOPIC
title          = TEXT_TITLE
text           = TEXT_TEXT
rawcontent     = TEXT_RAWCONTENT
online         = TEXT_ISONLINE
editableby     = TEXT_EDITABLEBY
discussions    = TEXT_HASDISCUSSIONS
createtime     = TEXT_CREATETIME
modifytime     = TEXT_MODIFYTIME
ipaddress      = TEXT_IPADDRESS
reads          = TEXT_READS
reads.private  = true

##
## collections
##
_children            = collection(Comment)
_children.local      = TEXT_ID
_children.foreign    = TEXT_F_TEXT_STORY
_children.order      = TEXT_CREATETIME ASC
_children.filter     = TEXT_F_TEXT_PARENT is null
_children.cachemode  = aggressive

comments             = collection(Comment)
comments.local       = TEXT_ID
comments.foreign     = TEXT_F_TEXT_STORY
comments.filter      = TEXT_ISONLINE > 0
comments.order       = TEXT_MODIFYTIME DESC
comments.cachemode   = aggressive