Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.notes
Class Note

java.lang.Object
  extended by ch.elexis.data.PersistentObject
      extended by ch.elexis.notes.Note
All Implemented Interfaces:
IPersistentObject, ISelectable

public class Note
extends PersistentObject

A Note is an arbitrary Text or BLOB with a name and optional keywords. A Note can consist of or contain external links to files in the file system or URLs. Notes are stored hierarchically in a tree-like structure (which ist mapped to a flat database table via a "parent"-field).

Author:
gerry

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.elexis.data.PersistentObject
PersistentObject.FieldType
 
Field Summary
static java.lang.String FLD_CONTENTS
           
static java.lang.String FLD_KEYWORDS
           
static java.lang.String FLD_MIMETYPE
           
static java.lang.String FLD_REFS
           
static java.lang.String FLD_TITLE
           
 
Fields inherited from class ch.elexis.data.PersistentObject
CACHE_DEFAULT_LIFETIME, CACHE_MIN_LIFETIME, CFG_CONNECTSTRING, CFG_DRIVER, CFG_PWD, CFG_TYPE, CFG_USER, DELETED, EXISTS, INEXISTENT, INVALID_ID, MATCH_AUTO, MATCH_CONTAINS, MATCH_EXACT, MATCH_REGEXP, MATCH_START
 
Fields inherited from interface ch.elexis.core.data.IPersistentObject
FLD_DATE, FLD_DELETED, FLD_EXTINFO, FLD_ID, FLD_LASTUPDATE, STATE_EXISTING, STATE_INEXISTENT, STATE_INVALID_ID
 
Constructor Summary
Note(Note parent, java.lang.String title, byte[] contents, java.lang.String mimetype)
          Create a new Note with binary content
Note(Note parent, java.lang.String title, java.lang.String text)
          Create a new Note with text content
 
Method Summary
 void addRef(java.lang.String ref)
          Add a new external ref
 boolean delete()
          Ein Objekt und ggf. dessen XID's aus der Datenbank löschen the object is not deleted but rather marked as deleted.
 java.util.List<Note> getChildren()
          find the children of this note
 byte[] getContent()
          retrieve the content of this note
 java.lang.String getKeywords()
          retrieve the keywords that are associated with this note.
 java.lang.String getLabel()
          Einen menschenlesbaren Identifikationsstring für dieses Objet liefern
 Note getParent()
          find the parent note of this note
 java.util.List<java.lang.String> getRefs()
          Return externals references associated with this Note
static Note load(java.lang.String id)
           
 void removeRef(java.lang.String ref)
          remove an external reference
 void setContent(byte[] cnt)
          Set new binary content to the current note.
 void setKeywords(java.lang.String kw)
          Enter keywords for this note
 
Methods inherited from class ch.elexis.data.PersistentObject
addChangeListener, addSticker, addToList, addXid, begin, checkNull, checkZero, checkZeroDouble, clearCache, connect, connect, deleteList, disconnect, equals, executeSQLScript, exists, exportData, fireChangeEvent, flatten, fold, get, get, getCacheTime, getConnection, getDefaultCacheLifetime, getFieldType, getId, getInt, getLastUpdate, getList, getList, getMap, getSticker, getStickers, getWrappedId, getXid, getXid, getXids, hashCode, isAvailable, isDeleted, isDragOK, isMatching, isMatching, isMatching, isMatching, isShowDeleted, isValid, lock, map, relock, removeChangeListener, removeFromList, removeFromList, removeSticker, resetCache, set, set, setDefaultCacheLifetime, setInt, setMap, setShowDeleted, setTrace, state, storeToString, tableExists, ts, undelete, unlock
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLD_MIMETYPE

public static final java.lang.String FLD_MIMETYPE
See Also:
Constant Field Values

FLD_KEYWORDS

public static final java.lang.String FLD_KEYWORDS
See Also:
Constant Field Values

FLD_REFS

public static final java.lang.String FLD_REFS
See Also:
Constant Field Values

FLD_CONTENTS

public static final java.lang.String FLD_CONTENTS
See Also:
Constant Field Values

FLD_TITLE

public static final java.lang.String FLD_TITLE
See Also:
Constant Field Values
Constructor Detail

Note

public Note(Note parent,
            java.lang.String title,
            java.lang.String text)
Create a new Note with text content

Parameters:
parent - the parent note or null if this is a top level note
title - a Title for this note
text - the text content of this note

Note

public Note(Note parent,
            java.lang.String title,
            byte[] contents,
            java.lang.String mimetype)
Create a new Note with binary content

Parameters:
parent - the parent note or null if this is a top level note
title - a Title for this note
contents - the contents of this note in
mimettype - the mimetype of the contents
Method Detail

getParent

public Note getParent()
find the parent note of this note

Returns:
the parent note or null if this is a top level note.

getChildren

public java.util.List<Note> getChildren()
find the children of this note

Returns:
a list of all Notes that are children of the current note. The list might me empty but is never null.

setContent

public void setContent(byte[] cnt)
Set new binary content to the current note. Any old content will be overwritten.

Parameters:
cnt - the new content

getContent

public byte[] getContent()
retrieve the content of this note

Returns:
a byte[] containing the data for this note's content

getKeywords

public java.lang.String getKeywords()
retrieve the keywords that are associated with this note.

Returns:
a String with a comma separated list of keywords that may be empty but is never null

setKeywords

public void setKeywords(java.lang.String kw)
Enter keywords for this note

Parameters:
kw - a string with a comma separated list of keywords (at most 250 chars)

getRefs

public java.util.List<java.lang.String> getRefs()
Return externals references associated with this Note

Returns:
a List with urls of external refs

addRef

public void addRef(java.lang.String ref)
Add a new external ref

Parameters:
ref - a string representing an URL

removeRef

public void removeRef(java.lang.String ref)
remove an external reference

Parameters:
ref - the reference to remove

getLabel

public java.lang.String getLabel()
Description copied from class: PersistentObject
Einen menschenlesbaren Identifikationsstring für dieses Objet liefern

Specified by:
getLabel in interface IPersistentObject
Specified by:
getLabel in class PersistentObject

delete

public boolean delete()
Description copied from class: PersistentObject
Ein Objekt und ggf. dessen XID's aus der Datenbank löschen the object is not deleted but rather marked as deleted. A purge must be applied to remove the object really

Overrides:
delete in class PersistentObject
Returns:
true on success

load

public static Note load(java.lang.String id)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis