public interface Journal
JournalEntry
.Modifier and Type | Field and Description |
---|---|
static String |
ANONYMOUS |
static String |
AUTHOR_MAPPING_PREFIX |
static String |
DEFAULT_RESOURCE_TYPE |
static String |
DEFAULT_TEMPLATE |
static String |
DEFAULT_TITLE |
static String |
FEED_SUFFIX |
static String |
GENERATOR_NAME |
static String |
GENERATOR_URL |
static String |
NODE_ENTRIES |
static String |
PARAM_AUTHOR |
static String |
PARAM_PERIOD |
static String |
PARAM_QUERY |
static String |
PARAM_TAG |
static String |
PARAM_VIEW |
static String |
PROP_DESCRIPTION |
static String |
PROP_JOURNAL_ARCHIVE |
static String |
PROP_RESOURCE_TYPE |
static String |
PROP_TEMPLATE |
static String |
PROP_TITLE |
static String |
TRACKBACK_SUFFIX |
static String |
URL_SUFFIX |
static String |
VIEW_ARCHIVE |
static String |
VIEW_AUTHOR |
static String |
VIEW_DEFAULT |
static String |
VIEW_EDIT |
static String |
VIEW_NEW |
static String |
VIEW_SEARCH |
static String |
VIEW_TAG |
Modifier and Type | Method and Description |
---|---|
JournalEntry |
addEntry(String title,
String text,
Date date,
String author)
Adds a new entry to this journal.
|
JournalEntry |
addEntry(String title,
String text,
Date date,
String author,
List<javax.activation.DataSource> attachmentDataSources)
Adds a new entry to this journal.
|
JournalEntry |
addPage(String title,
String text,
String author)
Adds a new page to this journal.
|
JournalEntry |
addPage(String title,
String text,
String author,
List<javax.activation.DataSource> attachmentDataSources)
Adds a new page to this journal.
|
void |
deleteEntry(JournalEntry entry)
Deletes the journal entry
|
String |
getAddEntryUrl(SlingHttpServletRequest request)
Returns the URL where a new journal entry can be added, or
null if not available. |
JournalArchive |
getArchive(int max,
DateFormat dateFormat)
Returns the archive for this journal.
|
String |
getArchiveAsHTML(int max,
DateFormat dateFormat)
Returns an HTML list created from the archive of this journal.
|
String |
getArchiveAsHTML(int max,
DateFormat dateFormat,
ResourceBundle resourceBundle)
Returns an HTML list created from the archive of this journal.
|
String |
getAuthorAsHTML(String author)
Returns the specified author as an HTML link.
|
String |
getAuthorAsHTML(String author,
ResourceBundle resourceBundle)
Returns the specified author as an HTML link.
|
String[] |
getAuthors()
Returns all authors of this journal.
|
String |
getAuthorsAsHTML()
Returns all authors of this journal as a list of HTML links.
|
String |
getAuthorsAsHTML(ResourceBundle resourceBundle)
Returns all authors of this journal as a list of HTML links.
|
String |
getDescription()
Returns the description of this journal.
|
List<JournalEntry> |
getEntries()
Returns the entries in this journal.
|
List<JournalEntry> |
getEntries(JournalEntryFilter filter)
Returns the entries in this journal using the specified filter.
|
List<JournalEntry> |
getEntries(List<JournalEntryFilter> filters)
Returns the entries in this journal using the specified filters.
|
JournalEntry |
getEntry()
Returns the journal entry if the underlying page is a journal entry page, or
null if it is a main
journal page. |
String |
getFeedUrl()
Returns the URL of the feed for this journal as absolute URL.
|
String |
getFeedUrl(boolean absolute)
Returns the URL of the feed for this journal.
|
String |
getFullUrl()
Returns the full URL of this journal, including scheme, server name and port.
|
JournalEntry |
getNextEntry(JournalEntry refEntry)
Returns the entry after the specified entry or
null if the specified entry is the last one. |
Page |
getPage()
Returns the page associated with this journal.
|
List<JournalEntry> |
getPages()
Returns the pages in this journal.
|
String |
getPagesAsHTML()
Returns the pages in this journal as a list of HTML links.
|
JournalEntry |
getPreviousEntry(JournalEntry refEntry)
Returns the entry before the specified entry or
null if the specified entry is the first one. |
Resource |
getResource()
Returns the resource associated with this journal entry.
|
String |
getTagAsHTML(Tag tag)
Returns the specified tag as an HTML link.
|
String |
getTagAsHTML(Tag tag,
ResourceBundle resourceBundle)
Returns the specified tag as an HTML link.
|
int |
getTagCount(Tag tag)
Returns the number of journal entries filed under the specified tag.
|
Tag[] |
getTags()
Returns all tags entries in this journal are filed under.
|
String |
getTagsAsHTML()
Returns all tags entries in this journal are filed under as a list of HTML links.
|
String |
getTagsAsHTML(ResourceBundle resourceBundle)
Returns all tags entries in this journal are filed under as a list of HTML links.
|
String |
getTitle()
Returns the title of this journal.
|
String |
getUrl()
Returns the server-local URL of this journal, omitting scheme, server name and port number.
|
String |
getViewUrl(String view)
Returns the URL for view of this journal.
|
boolean |
isArchive()
Returns whether the underlying resource is a journal archive, i.e.
|
boolean |
isEmpty()
Returns whether the journal contains any journal entries.
|
boolean |
isEntry()
Returns whether the underlying resource is a journal entry.
|
boolean |
isModified()
Returns whether this journal has been modified and needs to be saved.
|
void |
save()
Saves all changes made to this journal.
|
void |
setDescription(String desc)
Sets the description of this journal.
|
void |
setTitle(String title)
Sets the title of this journal.
|
static final String ANONYMOUS
static final String NODE_ENTRIES
static final String URL_SUFFIX
static final String FEED_SUFFIX
static final String TRACKBACK_SUFFIX
static final String GENERATOR_NAME
static final String GENERATOR_URL
static final String PARAM_VIEW
static final String PARAM_PERIOD
static final String PARAM_QUERY
static final String PARAM_TAG
static final String PARAM_AUTHOR
static final String VIEW_DEFAULT
static final String VIEW_NEW
static final String VIEW_EDIT
static final String VIEW_SEARCH
static final String VIEW_ARCHIVE
static final String VIEW_AUTHOR
static final String VIEW_TAG
static final String PROP_TITLE
static final String PROP_DESCRIPTION
static final String PROP_TEMPLATE
static final String PROP_RESOURCE_TYPE
static final String PROP_JOURNAL_ARCHIVE
static final String DEFAULT_TEMPLATE
static final String DEFAULT_RESOURCE_TYPE
static final String DEFAULT_TITLE
static final String AUTHOR_MAPPING_PREFIX
List<JournalEntry> getEntries()
List<JournalEntry> getEntries(JournalEntryFilter filter)
filter
- The journal entry filterList<JournalEntry> getEntries(List<JournalEntryFilter> filters)
filters
- The journal entry filtersList<JournalEntry> getPages()
String getPagesAsHTML()
getPages()
JournalEntry addEntry(String title, String text, Date date, String author)
title
- The title of the journal entrytext
- The text of the journal entrydate
- The date of the journal entry (optional)author
- the Author of the journal entryJournalEntry addEntry(String title, String text, Date date, String author, List<javax.activation.DataSource> attachmentDataSources)
title
- The title of the journal entrytext
- The text of the journal entrydate
- The date of the journal entry (optional)author
- the Author of the journal entryattachmentDataSources
- a list of file attachments to include in the postJournalEntry addPage(String title, String text, String author)
title
- The title of the journal entrytext
- The text of the journal entryauthor
- the author of the journal entryJournalEntry addPage(String title, String text, String author, List<javax.activation.DataSource> attachmentDataSources)
title
- The title of the journal entrytext
- The text of the journal entryauthor
- the author of the journal entryattchmentDataSources
- a list of file attachments to include in the postJournalEntry getPreviousEntry(JournalEntry refEntry)
null
if the specified entry is the first one.refEntry
- The reference entryJournalEntry getNextEntry(JournalEntry refEntry)
null
if the specified entry is the last one.refEntry
- The reference entryTag[] getTags()
String getTagAsHTML(Tag tag)
tag
- The tagString getTagAsHTML(Tag tag, ResourceBundle resourceBundle)
tag
- The tagresourceBundle
- ResourceBundle
to use for translationsString getTagsAsHTML()
String getTagsAsHTML(ResourceBundle resourceBundle)
resourceBundle
- ResourceBundle
to use for translationsint getTagCount(Tag tag)
tag
- The tagString[] getAuthors()
String getAuthorAsHTML(String author)
author
- The author nameString getAuthorAsHTML(String author, ResourceBundle resourceBundle)
author
- The author nameresourceBundle
- ResourceBundle
to use for translationsString getAuthorsAsHTML()
String getAuthorsAsHTML(ResourceBundle resourceBundle)
resourceBundle
- ResourceBundle
to use for translationsPage getPage()
Resource getResource()
JournalEntry getEntry()
null
if it is a main
journal page.boolean isEntry()
true
if the underlying resource is a journal entry, false
otherwiseboolean isArchive()
true
if the underlying resource is a journal archive, false
otherwiseString getTitle()
void setTitle(String title)
title
- The titleString getDescription()
void setDescription(String desc)
desc
- The descriptionString getUrl()
String getFullUrl()
String getFeedUrl()
String getFeedUrl(boolean absolute)
absolute
- true if the URL should be absolute (http://server.com/journal), false if it should be relative
(/journal)String getViewUrl(String view)
VIEW_DEFAULT
(default)VIEW_EDIT
VIEW_SEARCH
VIEW_ARCHIVE
view
- The viewString getAddEntryUrl(SlingHttpServletRequest request)
null
if not available.request
- The requestboolean isEmpty()
true
if journal is empty, false
otherwiseJournalArchive getArchive(int max, DateFormat dateFormat)
max
- The maximum number of items (optional)dateFormat
- The date format (optional)String getArchiveAsHTML(int max, DateFormat dateFormat)
max
- The maximum number of items (optional)dateFormat
- The date format (optional)String getArchiveAsHTML(int max, DateFormat dateFormat, ResourceBundle resourceBundle)
max
- The maximum number of items (optional)dateFormat
- The date format (optional)resourceBundle
- ResourceBundle
to use for translationsboolean isModified()
true
if journal is modified, false
otherwisesave()
void save() throws JournalException
JournalException
- if saving failsvoid deleteEntry(JournalEntry entry)
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"