Story.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 |
Sourcecode in Story/objectFunctions.js:
1: function incrementReadCounter() { 2: // check if app.data.readLog already contains 3: // an Object representing this story 4: if (!app.data.readLog.containsKey(String(this._id))) { 5: var logObj = new Object(); 6: logObj.site = this.site.alias; 7: logObj.story = this._id; 8: logObj.reads = this.reads + 1; 9: app.data.readLog.put(String(this._id), logObj); 10: } else 11: app.data.readLog.get(String(this._id)).reads++; 12: return; 13: } |