/*!
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
define(
[ 'aloha/core', 'util/class'],
function( Aloha, Class ) {
var
// Aloha = window.Aloha,
// Class = window.Class,
GENTICS = window.GENTICS;
Aloha.RepositoryObject = function() {};
/**
* @namespace Aloha.Repository
* @class Document
* @constructor
*
* Abstract Document suitable for most Objects.
*
* Example:
*
var item = new Aloha.Repository.Document({
id: 1,
repositoryId: 'myrepository',
name: 'Aloha Editor - The HTML5 Editor',
type: 'website',
url:'http://aloha-editor.com',
});
*
* @param {Object} properties An object with the data.
*
* id
: String Unique identifier
* repositoryId
: String Unique repository identifier
* name
: String Name of the object. This name is used to display
* type
: String The specific object type
* partentId
: String (optional)
* mimetype
: String (optional) MIME type of the Content Stream
* filename
: String (optional) File name of the Content Stream
* length
: String (optional) Length of the content stream (in bytes)
* url
: String (optional) URL of the content stream
* renditions
: Array (optional) Array of different renditions of this object
* localName
: String (optional) Name of the object. This name is used internally
* createdBy
: String (optional) User who created the object
* creationDate
: Date (optional) DateTime when the object was created
* lastModifiedBy
: String (optional) User who last modified the object
* lastModificationDate
: Date (optional) DateTime when the object was last modified
*
*
*/
Aloha.RepositoryDocument = Class.extend({
_constructor: function (properties) {
var p = properties;
this.type = 'document';
// Basic error checking for MUST attributes
if (!p.id ||
!p.name ||
!p.repositoryId
) {
// Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
return;
}
GENTICS.Utils.applyProperties(this, properties);
this.baseType = 'document';
}
// /**
// * Not implemented method to generate this JS API doc correctly.
// */
// ,empty = function() }
});
/**
* @namespace Aloha.Repository
* @class Folder
* @constructor
* Abstract Folder suitable for most strucural Objects.
*
* Example:
*
var item = new Aloha.Repository.Folder({
id: 2,
repositoryId: 'myrepository',
name: 'images',
type: 'directory',
parentId:'/www'
});
* @param {Object} properties An object with the data.
*
* id
: String Unique identifier
* repositoryId
: String Unique repository identifier
* name
: String Name of the object. This name is used to display
* type
: String The specific object type
* partentId
: String (optional)
* localName
: String (optional) Name of the object. This name is used internally
* createdBy
: String (optional) User who created the object
* creationDate
: Date (optional) DateTime when the object was created
* lastModifiedBy
: String (optional) User who last modified the object
* lastModificationDate
: Date (optional) DateTime when the object was last modified
*
*
*/
Aloha.RepositoryFolder = Class.extend({
_constructor: function(properties) {
var p = properties;
this.type = 'folder';
// Basic error checking for MUST attributes
if (!p.id ||
!p.name ||
!p.repositoryId
) {
// Aloha.Log.error(this, "No valid Aloha Object. Missing MUST property");
return;
}
GENTICS.Utils.applyProperties(this, properties);
this.baseType = 'folder';
}
// /**
// * Not implemented method to generate this JS API doc correctly.
// */
// ,empty = function() {};
});
});