// collection.js
//
// data object representing an collection
//
// Copyright 2011, StatusNet Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

var DatabankObject = require("databank").DatabankObject,
    ActivityObject = require("./activityobject").ActivityObject;

var Collection = DatabankObject.subClass("collection", ActivityObject);

Collection.schema = {
    pkey: "id",
    fields: ["author",
             "displayName",
             "image",
             "objectTypes",
             "published",
             "summary",
             "updated",
             "url"]
};

exports.Collection = Collection;

@@ -75,16 +75,21 @@
 ght 2011
+-2012
 , Status
@@ -97,16 +97,16 @@
 et Inc.%0A
-
 //%0A// Li
@@ -660,16 +660,47 @@
 e.%0A%0Avar 
+_ = require(%22underscore%22),%0A    
 Databank
@@ -1092,24 +1092,24 @@
  %22updated%22,%0A
-
             
@@ -1120,16 +1120,1314 @@
 l%22%5D%0A%7D;%0A%0A
+Collection.isFolder = function(props, callback) %7B%0A    var User = require(%22./user%22).User;%0A%0A    if (_(props).has('author') &&%0A        _(props.author).has('id') &&%0A        _(props).has('objectTypes') &&%0A        _(props).has('displayName') &&%0A        _(props.objectTypes).isArray() &&%0A        props.objectTypes.length === 1) %7B%0A        User.fromPerson(props.author.id, function(err, user) %7B%0A            if (err) %7B%0A                callback(err, null);%0A            %7D else if (!user) %7B%0A                callback(null, false);%0A            %7D else %7B%0A                callback(null, true);%0A            %7D%0A        %7D);%0A    %7D else %7B%0A        callback(null, false);%0A    %7D%0A%7D;%0A%0ACollection.checkFolder = function(props, callback) %7B%0A%7D;%0A%0ACollection.beforeCreate = function(props, callback) %7B%0A    Collection.checkFolder(props, function(err, props) %7B%0A        if (err) %7B%0A            callback(err, null);%0A        %7D else %7B%0A            Collection.parent.beforeCreate(props, callback);%0A        %7D%0A    %7D);%0A%7D;%0A%0ACollection.prototype.afterCreate = function(callback) %7B%0A    Collection.checkFolder(props, function(err, props) %7B%0A        if (err) %7B%0A            callback(err, null);%0A        %7D else %7B%0A            Collection.parent.beforeCreate(props, callback);%0A        %7D%0A    %7D);%0A%7D;%0A%0ACollection.prototype.afterDel = function(callback) %7B%0A%7D;%0A%0A
 exports.

Revert "Revert "some updates to collection""