com.wewebu.ow.server.fieldctrlimpl
Class OwFieldManagerControlNote.OwNoteDataModel

java.lang.Object
  extended by com.wewebu.ow.server.fieldctrlimpl.OwFieldManagerControlNote.OwNoteDataModel
Enclosing class:
OwFieldManagerControlNote

public static class OwFieldManagerControlNote.OwNoteDataModel
extends Object

Class holding the new note data model.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
static String NOTE_DELIMITER
          delimiter for note
static String NOTE_DELIMITER_REGEXP
          delimiter for note regexp
 
Constructor Summary
OwFieldManagerControlNote.OwNoteDataModel(Locale locale_p, String noteContent_p)
          Constructor - create a list of m_notes from note m_content, if it's possible.
OwFieldManagerControlNote.OwNoteDataModel(Locale locale_p, String noteContent_p, boolean showNewNotesAtTheEnd_p)
          Constructor - create a list of m_notes from note m_content, if it's possible.
 
Method Summary
 void appendNote(OwFieldManagerControlNote.OwNote note_p)
          Append a note to this model
 OwFieldManagerControlNote.OwNote getNote(int index_p)
          Get the note specified by index, or null.
 String getNoteRawContent()
          Get the note m_content as was set.
 List getNotes()
          Get the list of m_notes
 int getNumberOfNotes()
          Get the number of m_notes.
 List getShortenedNotes()
          Get a list with shortened m_notes.
 int getSize()
          Get the size occupied by this note.
 String getTrimmedText()
          Get the m_content of this note model, as needed to be saved in m_content manager system.
 boolean isLastNoteShortened()
          Returns true in case the last note was shortened.
 boolean isNullContent()
          Check if this note model content is null;
 void setMaxSize(int maxSize_p)
          Set max size for this note.
 void setShortenThreshold(int shortenThreshold_p)
          Set the threshold: the note with size over this threshold will be shortened.
 boolean shouldShortenNotes()
          Check if the note need to be shortened.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOTE_DELIMITER

public static final String NOTE_DELIMITER
delimiter for note

See Also:
Constant Field Values

NOTE_DELIMITER_REGEXP

public static final String NOTE_DELIMITER_REGEXP
delimiter for note regexp

See Also:
Constant Field Values
Constructor Detail

OwFieldManagerControlNote.OwNoteDataModel

public OwFieldManagerControlNote.OwNoteDataModel(Locale locale_p,
                                                 String noteContent_p)
                                          throws OwFieldManagerControlNote.OwNoteException
Constructor - create a list of m_notes from note m_content, if it's possible.

Parameters:
locale_p - - the current locale
noteContent_p - - m_content for the note
Throws:
OwFieldManagerControlNote.OwNoteException - - thrown when the note model cannot be created from the given string

OwFieldManagerControlNote.OwNoteDataModel

public OwFieldManagerControlNote.OwNoteDataModel(Locale locale_p,
                                                 String noteContent_p,
                                                 boolean showNewNotesAtTheEnd_p)
                                          throws OwFieldManagerControlNote.OwNoteException
Constructor - create a list of m_notes from note m_content, if it's possible.

Parameters:
locale_p - - the current locale
noteContent_p - - m_content for the note
showNewNotesAtTheEnd_p - - if true the new notes are shown at the end of the field.
Throws:
OwFieldManagerControlNote.OwNoteException - - thrown when the note model cannot be created from the given string
Method Detail

getNoteRawContent

public String getNoteRawContent()
Get the note m_content as was set.

Returns:
the original note m_content.

isNullContent

public boolean isNullContent()
Check if this note model content is null;

Returns:
- true if this model content is null.
Since:
3.1.0.0

appendNote

public void appendNote(OwFieldManagerControlNote.OwNote note_p)
                throws OwFieldManagerControlNote.OwNoteException
Append a note to this model

Parameters:
note_p -
Throws:
OwFieldManagerControlNote.OwNoteException

getSize

public int getSize()
Get the size occupied by this note.

Returns:
the size

getNotes

public List getNotes()
Get the list of m_notes

Returns:
- the list of m_notes.

getTrimmedText

public String getTrimmedText()
Get the m_content of this note model, as needed to be saved in m_content manager system. The delimiter between m_notes is "\n " string.

Returns:
the m_content of all m_notes related to this model, as described in the specification.

getNumberOfNotes

public int getNumberOfNotes()
Get the number of m_notes.

Returns:
- number of m_notes.

getNote

public OwFieldManagerControlNote.OwNote getNote(int index_p)
Get the note specified by index, or null.

Parameters:
index_p -
Returns:
the note corresponding to the given index, or null.

isLastNoteShortened

public boolean isLastNoteShortened()
Returns true in case the last note was shortened.

Returns:
- true in case the last note was shortened.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

setMaxSize

public void setMaxSize(int maxSize_p)
Set max size for this note.

Parameters:
maxSize_p -

setShortenThreshold

public void setShortenThreshold(int shortenThreshold_p)
Set the threshold: the note with size over this threshold will be shortened. This apply only for m_notes displayed in Result Lists.

Parameters:
shortenThreshold_p -

shouldShortenNotes

public boolean shouldShortenNotes()
Check if the note need to be shortened.

Returns:
true if the note should be shortened.

getShortenedNotes

public List getShortenedNotes()
Get a list with shortened m_notes.

Returns:
the shortened m_notes lists.


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.