Commits

watermelon  committed 889089c

improve ndoc output

  • Participants
  • Parent commits 8b5061a

Comments (0)

Files changed (7)

File src/main/client/comm/Communicator.js

 //
 
 /**
- * class Communicator
+ * class bookmaak.comm.Communicator
  *
  * This file contains the Communicator class.
  * Communicator does communicate with a bookmark server.
  **/
 
 /**
- * new Communicator(serverUrl)
+ * new bookmaak.comm.Communicator(serverUrl)
  *
  * The Communicator constructor.
  * 
 	 * ************************/
 	
 	/**
-	 * Communicator#retrieveFile(String, Function)
+	 * bookmaak.comm.Communicator#retrieveFile(String, Function)
 	 * 
 	 * **file_type** the file to retrieve BOOKMARK or USER<br/>
 	 * **callback** callback, passsing result and File<br/>
 	
 	
 	/**
-	 * Communicator#sendFile(File, Function)
+	 * bookmaak.comm.Communicator#sendFile(File, Function)
 	 * 
 	 * **file** the file to be sent<br/>
 	 * **callback** callback, passsing result<br/>

File src/main/client/crypto/BookmarkCrypto.js

 //
 
 /**
- * class BookmarkCrypto
+ * class bookmaak.crypto.BookmarkCrypto
  * 
  * The crypto layer object.
  * It does the encryption and the decryption of the bookmark file.
 
 
 /**
- * new BookmarkCrypto(String)
+ * new bookmaak.crypto.BookmarkCrypto(String)
  * 
  * The constructor takes the symmKey.
  * 
      * ************************/
      
 	/**
-	 * BookmarkCrypto#encrypt(File) -> File
+	 * bookmaak.crypto.BookmarkCrypto#encrypt(File) -> File
 	 * 
 	 * Encrypts a plain file.
 	 * 
 	
 	
 	/**
-	 * BookmarkCrypto#decrypt(File) -> File
+	 * bookmaak.crypto.BookmarkCrypto#decrypt(File) -> File
 	 * 
 	 * Decrypts an encrypted file.
 	 * 

File src/main/client/crypto/UserCrypto.js

 //
 
 /**
- * class UserCrypto
+ * class bookmaak.crypto.UserCrypto
  * 
  * Intended to figure out whats the bm file and the symmetric key..
  * Returns a BookmarkCrypto object if everything goes well.
  **/
 
 /**
- * new UserCrypto(String, String)
+ * new bookmaak.crypto.UserCrypto(String, String)
  * 
  * Constructor of the crypto layer object that extracts the user's data from the
  * users file.
 	 * ************************/
 	
 	/**
-	 * UserCrypto#encryptUserFile(File) -> File
+	 * bookmaak.crypto.UserCrypto#encryptUserFile(File) -> File
 	 *
 	 * brauchen wir derzeit nicht... erst wenn wir den symmetrischen schl�ssel
 	 * �ndern wollen
 	 
 	 
 	/**
-	 * UserCrypto#getSymmKeyFrom(File) -> String
+	 * bookmaak.crypto.UserCrypto#getSymmKeyFrom(File) -> String
 	 *
 	 * **cipherFile** the encrypted users file.
 	 * returns the base64 encoded aes key

File src/main/client/dao/BookmarkDao.js

 //
 
 /**
- * class BookmarkDao
+ * class bookmaak.dao.BookmarkDao
  *
  * Allows access to the bookmarks. 
  *
  **/
 
 /**
- * new BookmarkDao(String, Communicator, BookmarkCrypto)
+ * new bookmaak.dao.BookmarkDao(String, Communicator, BookmarkCrypto)
  *
  * Setter for the communication layer.
  *
 	 * ************************/
 	
 	/**
-	 * BookmarkDao#commit() -> Boolean
+	 * bookmaak.dao.BookmarkDao#commit() -> Boolean
 	 * 
 	 * Commits the changes to the server.
 	 **/
 	
 	
 	/**
-	 * BookmarkDao#addBookmark(Bookmark) -> Boolean
+	 * bookmaak.dao.BookmarkDao#addBookmark(Bookmark) -> Boolean
 	 *
 	 * Adds new bookmark to the store.
 	 *
 	
 	
 	/**
-	 * BookmarkDao#updateBookmark(Bookmark) -> Boolean
+	 * bookmaak.dao.BookmarkDao#updateBookmark(Bookmark) -> Boolean
 	 *
 	 * Changes the bookmark bookmark and stores it.
 	 *
 	
 	
 	/**
-	 * BookmarkDao#deleteBookmark(Bookmark) -> Boolean
+	 * bookmaak.dao.BookmarkDao#deleteBookmark(Bookmark) -> Boolean
 	 *
 	 * Deletes the bookmark.
 	 *
 	
 	
 	/**
-	 * BookmarkDao#getAllBookmark() -> Array
+	 * bookmaak.dao.BookmarkDao#getAllBookmark() -> Array
 	 *
 	 * Returns all bookmarks
 	 *
 	
 	
 	/**
-	 * BookmarkDao#getBookmarks_by_tag(String) -> Array
+	 * bookmaak.dao.BookmarkDao#getBookmarks_by_tag(String) -> Array
 	 *
 	 * Gets all bookmarks with the specified tag.
 	 *
 	
 	
 	/**
-	 * BookmarkDao#getBookmarks_by_meta(String) -> Array
+	 * bookmaak.dao.BookmarkDao#getBookmarks_by_meta(String) -> Array
 	 *
 	 * Gets all bookmarks containing the specified meta tag.
 	 *
 	
 	
 	/**
-	 * BookmarkDao#getBookmarks_by_keyword(String) -> Array
+	 * bookmaak.dao.BookmarkDao#getBookmarks_by_keyword(String) -> Array
 	 *
 	 * Gets all bookmarks with the specified key word.
 	 * A key word can be a meta info or tag, or included in a link.
      * ************************/
      
 	/**
-	 * BookmarkDao#fetchBookmarks()
+	 * bookmaak.dao.BookmarkDao#fetchBookmarks()
 	 * 
 	 * Calls the communicator to retrive the file from the server
 	 **/
 	
 	
 	/**
-	 * BookmarkDao#sendBookmarks()
+	 * bookmaak.dao.BookmarkDao#sendBookmarks()
 	 * 
 	 * Calls the communicator to send the file to the server
 	 **/
      * ************************/
 	
 	/**
-	 * BookmarkDao#setFileName(String)
+	 * bookmaak.dao.BookmarkDao#setFileName(String)
 	 *
 	 * Sets the (file) name of the bookmark store.
 	 * To retrieve the bookmark store via the communicator,
 	
 	
 	/**
-	 * BookmarkDao#setComm(Communicator)
+	 * bookmaak.dao.BookmarkDao#setComm(Communicator)
 	 *
 	 * Sets the communicator to the bookmark store.
 	 * Bookmark files are accessed via the communicator.
 	
 	
 	/**
-	 * BookmarkDao#setBookmarkCrypto(BookmarkCrypto)
+	 * bookmaak.dao.BookmarkDao#setBookmarkCrypto(BookmarkCrypto)
 	 *
 	 * Sets the bookmark crypto object.
 	 * Bookmark files are encrypted symmetraically.

File src/main/client/domain/Bookmark.js

 //
 
 /**
- * class Bookmark
+ * class bookmaak.domain.Bookmark
  *
  * This file contains the class of the Bookmark domain object.
  **/
 
 
 /**
- * new Bookmark(String, String[, Array[, Array]])
+ * new bookmaak.domain.Bookmark(String, String[, Array[, Array]])
  *
  * **_title** the title of the bookmark (i.e. the page's title)
  * **_url** the page url
 	 * ************************/
 	
 	/**
-	 * Bookmark#addTag(String)
+	 * bookmaak.domain.Bookmark#addTag(String)
 	 *
 	 * TODO needs testing
 	 *
 	};
 
 	/**
-	 * Bookmark#removeTag(String)
+	 * bookmaak.domain.Bookmark#removeTag(String)
 	 *
 	 * TODO needs testing
 	 *
 	};
 
 	/**
-	 * Bookmark#addMeta(String)
+	 * bookmaak.domain.Bookmark#addMeta(String)
 	 *
 	 * TODO needs testing
 	 *
 	};
 
 	/**
-	 * Bookmark#removeMeta(String)
+	 * bookmaak.domain.Bookmark#removeMeta(String)
 	 *
 	 * TODO needs testing
 	 *
 	};
 
 	/**
-	 * Bookmark#getAsText() -> String
+	 * bookmaak.domain.Bookmark#getAsText() -> String
 	 *
 	 * returns a string representation of the Bookmark#
 	 **/
 	};
 
 	/**
-	 * Bookmark#getAsHtmlLink() -> String
+	 * bookmaak.domain.Bookmark#getAsHtmlLink() -> String
 	 *
 	 * returns the bookmark as html <a href=...
 	 **/
      * ************************/
 
 	/**
-	 * Bookmark#getTitle() -> String
+	 * bookmaak.domain.Bookmark#getTitle() -> String
 	 *
 	 * returns the title of the Bookmark#
 	 **/
 	};
 
 	/**
-	 * Bookmark#getUrl() -> String
+	 * bookmaak.domain.Bookmark#getUrl() -> String
 	 *
 	 * returns the url of the Bookmark#
 	 **/
 	};
 
 	/**
-	 * Bookmark#getTags() -> Array
+	 * bookmaak.domain.Bookmark#getTags() -> Array
 	 *
 	 * returns the tags of the Bookmark#
 	 **/
 	};
 
 	/**
-	 * Bookmark#getMetas() -> Array
+	 * bookmaak.domain.Bookmark#getMetas() -> Array
 	 *
 	 * returns the meta tags of the Bookmark#
 	 **/
      * ************************/
 
 	/**
-	 * Bookmark#setTitle(String)
+	 * bookmaak.domain.Bookmark#setTitle(String)
 	 *
 	 * Sets the title of the bookmark to _title.
 	 *
 	};
 
 	/**
-	 * Bookmark#setUrl(String)
+	 * bookmaak.domain.Bookmark#setUrl(String)
 	 *
 	 * Sets the url of the bookmark to _url.
 	 *
 	};
 
 	/**
-	 * Bookmark#setTags(Array)
+	 * bookmaak.domain.Bookmark#setTags(Array)
 	 *
 	 * Sets the tags of the bookmark to _tags.
 	 *
 	};
 
 	/**
-	 * Bookmark#setMetas(Array)
+	 * bookmaak.domain.Bookmark#setMetas(Array)
 	 *
 	 * Sets the meta tags of the bookmark to _metas.
 	 *
      * ************************/
 
 	/**
-	 * Bookmark#toString() -> String
+	 * bookmaak.domain.Bookmark#toString() -> String
 	 *
 	 * returns A string representation of the bookmark.
 	 **/

File src/main/client/domain/File.js

 //
 
 /**
- * class File
+ * class bookmaak.domain.File
  * 
  * Virtual representation of a file.
  * Base type for a users files and a bookmark files.(TODO)
  **/
 
 /**
- * new File(String, String)
+ * new bookmaak.domain.File(String, String)
  * 
  * **_type** the file type
  * **_data** the content in b64

File src/test/client/domain/BookmarkTests.js

-/**
- * class Bookmark
- *
- * This file contains the class of the Bookmark domain object.
- **/
-
-
-/**
- * new Bookmark(String, String[, Array = [], Array = [] ])
- *
- * TODO ensure that tag and meta arrays contain only strings?!
- * TODO its improtant to make a utility function that checks function
- * parameters to reduce redundant code for checking in constructr and setters...
- * i.e. checkParam(param, acceptedTypes, defaultValue)
- *
- * **_title** the title of the bookmark (i.e. the page's title)
- * **_url** the page url
- * **_tags (optional)** a list of tags
- * **_metas (optional)** a list of meta tags retrieved from the page's header
- **/
-function Bookmark(_title, _url, _tags, _metas) {
-	
-	var that = this;
-	
-	
-	/* ************************
-	 * * Members
-	 * ************************/
-	
-	//title of the link, i.e. the page title
-	if(typeof _title == 'undefined')
-		throw "_title is undefined.";
-	else if(Object.prototype.toString.call(_title) == "[object String]")
-		var title = _title;
-	else
-		throw "illegal argument _title.";
-	
-
-	//url to a webpage
-	if(typeof _url == 'undefined')
-		throw "_url is undefined.";
-	else if(Object.prototype.toString.call(_url) == "[object String]")
-		var url = _url;
-	else
-		throw "illegal argument _url.";
-	
-
-	//the associated tags
-	if(typeof _tags == 'undefined')
-		var tags = new Array();
-	else if(Object.prototype.toString.call(_tags) == "[object Array]")
-		var tags = _tags;
-	else
-		throw "illegal argument _tags.";
-
-
-	//the webpage's meta tags
-	if(typeof _metas == 'undefined')
-		var metas = new Array();
-	else if(Object.prototype.toString.call(_metas) == "[object Array]")
-		var metas = _metas;
-	else
-		throw "illegal argument _metas.";
-
-
-
-	/* ************************
-     * * Functions
-     * ************************/
-
-	/**
-	 * Bookmark#addTag(String)
-	 *
-	 * TODO needs testing
-	 *
-	 * **_tag** the tag to be added to the Bookmark#
-	 **/
-	this.addTag = function(_tag) {
-	
-		tags.push(_tag);
-	};
-
-	/**
-	 * Bookmark#removeTag(String)
-	 *
-	 * TODO needs testing
-	 *
-	 * **_tag** the tag to be removed from the Bookmark#
-	 **/
-	this.removeTag = function(_tag) {
-	
-		for (var i = 0; i <= tags.length; i++) {
-			
-			if(tags[i] == _tag) {
-
-				tags.slice(i, 1);
-				break;
-			}
-		}
-	};
-
-	/**
-	 * Bookmark#addMeta(String)
-	 *
-	 * TODO needs testing
-	 *
-	 * **_meta** the meta tag to be added to the Bookmark#
-	 **/
-	this.addMeta = function(_meta) {
-	
-		metas.push(_meta);
-	};
-
-	/**
-	 * Bookmark#removeMeta(String)
-	 *
-	 * TODO needs testing
-	 *
-	 * **_meta** the meta tag to be removed from the Bookmark#
-	 **/
-	this.removeMeta = function(_meta) {
-	
-		for (var i = 0; i <= metas.length; i++) {
-			
-			if(metas[i] == _meta) {
-
-				metas.slice(i, 1);
-				break;
-			}
-		}
-	};
-
-	/**
-	 * Bookmark#getAsText() -> String
-	 *
-	 * returns a string representation of the Bookmark#
-	 **/
-	this.getAsText = function() {
-	
-		return title + ' - ' + url;
-	};
-
-	/**
-	 * Bookmark#getAsHtmlLink() -> String
-	 *
-	 * returns the bookmark as html <a href=...
-	 **/
-	this.getAsHtmlLink = function() {
-	
-		return '<a href="' + url + '">' + title + '</a>';
-	};
-	
-
-	
-	/* ************************
-     * * Getters
-     * ************************/
-
-	/**
-	 * Bookmark#getTitle() -> String
-	 *
-	 * returns the title of the Bookmark#
-	 **/
-	this.getTitle = function() {
-
-		return title;
-	};
-
-	/**
-	 * Bookmark#getUrl() -> String
-	 *
-	 * returns the url of the Bookmark#
-	 **/
-	this.getUrl = function() {
-
-		return url;
-	};
-
-	/**
-	 * Bookmark#getTags() -> Array
-	 *
-	 * returns the tags of the Bookmark#
-	 **/
-	this.getTags = function() {
-
-		return tags;
-	};
-
-	/**
-	 * Bookmark#getMetas() -> Array
-	 *
-	 * returns the meta tags of the Bookmark#
-	 **/
-	this.getMetas = function() {
-		
-		return metas;
-	};
-
-
-
-	/* ************************
-     * * Setters
-     * ************************/
-
-	/**
-	 * Bookmark#setTitle(String)
-	 *
-	 * Sets the title of the bookmark to _title.
-	 *
-	 * **_title** the new title of the bookmark
-	 **/
-	this.setTitle = function(_title) {
-		
-		if(typeof _title == 'undefined')
-			throw "_title is undefined.";
-		else if(Object.prototype.toString.call(_title) == "[object String]")
-			title = _title;
-		else
-			throw "illegal argument _title.";
-	};
-
-	/**
-	 * Bookmark#setUrl(String)
-	 *
-	 * Sets the url of the bookmark to _url.
-	 *
-	 * **_url** the new url of the bookmark
-	 **/
-	this.setUrl = function(_url) {
-		
-		if(typeof _url == 'undefined')
-			throw "_url is undefined.";
-		else if(Object.prototype.toString.call(_url) == "[object String]")
-			url = _url;
-		else
-			throw "illegal argument _url.";
-	};
-
-	/**
-	 * Bookmark#setTags(Array)
-	 *
-	 * Sets the tags of the bookmark to _tags.
-	 *
-	 * **_tags** array the new tags of the bookmark
-	 **/
-	this.setTags = function(_tags) {
-		
-		if(typeof _tags == 'undefined')
-			throw "_tags is undefined.";
-		else if(Object.prototype.toString.call(_tags) == "[object Array]")		
-			tags = _tags;
-		else
-			throw "illegal argument _tags.";
-	};
-
-	/**
-	 * Bookmark#setMetas(Array)
-	 *
-	 * Sets the meta tags of the bookmark to _metas.
-	 *
-	 * **_tags** array the new meta tags of the bookmark
-	 **/
-	this.setMetas = function(_metas) {
-		
-		if(typeof _metas == 'undefined')
-			throw "_metas is undefined.";
-		else if(Object.prototype.toString.call(_metas) == "[object Array]")
-			metas = _metas;
-		else
-			throw "illegal argument _metas.";
-	};
-
-
-	/* ************************
-     * * Overwritten functions
-     * ************************/
-
-	/**
-	 * Bookmark#toString() -> String
-	 *
-	 * returns A string representation of the bookmark.
-	 **/
-	this.toString = function() {
-
-		return ""
-				+ "title: " + title + "\n"
-				+ "url: " + url + "\n"
-				+ "tags: " + tags + "\n"
-				+ "metas: " + metas + "\n";
-	};
-};
-
-
 try {
 
 	var bm = new Bookmark("Wikiwoedia", "http://wwww.knikipedia.com/", []);