|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.core.content.PersistentObject
org.liquidsite.core.content.Content
org.liquidsite.core.content.ContentFile
A web site file.
| Field Summary |
| Fields inherited from class org.liquidsite.core.content.Content |
DOCUMENT_CATEGORY, FILE_CATEGORY, FOLDER_CATEGORY, FORUM_CATEGORY, NAME_CHARS, PAGE_CATEGORY, POST_CATEGORY, SECTION_CATEGORY, SITE_CATEGORY, TEMPLATE_CATEGORY, TOPIC_CATEGORY, TRANSLATOR_CATEGORY |
| Fields inherited from class org.liquidsite.core.content.PersistentObject |
BINDERS, LOWER_CASE, NUMBERS, UPPER_CASE |
| Constructor Summary | |
protected |
ContentFile(ContentManager manager,
ContentData data,
DataSource src)
Creates a new file. |
|
ContentFile(ContentManager manager,
Content parent,
java.lang.String name)
Creates a new file with default values. |
| Method Summary | |
void |
deleteRevision(User user)
Deletes this content revision from the database. |
protected void |
doDelete(DataSource src,
User user)
Deletes the object data from the database. |
protected void |
doUpdate(DataSource src,
User user)
Updates the object data in the database. |
protected void |
doValidate()
Validates the object data before writing to the database. |
java.io.File |
getFile()
Returns the file used for storing the data content. |
java.lang.String |
getFileName()
Returns the file name. |
java.lang.String |
getMimeType(javax.servlet.ServletContext context)
Returns the MIME type of the file. |
static java.lang.String |
getMimeType(javax.servlet.ServletContext context,
java.lang.String fileName)
Returns the MIME type of a file. |
java.lang.String |
getTextContent(javax.servlet.ServletContext context)
Returns the text content of a file. |
void |
setFileName(java.lang.String name)
Sets the file name. |
void |
setTextContent(java.lang.String content)
Sets the content of the file to the specified string. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class org.liquidsite.core.content.Content |
doInsert, equals, equals, getAllRevisions, getAttribute, getAttributeNames, getAuthor, getAuthorName, getCategory, getComment, getDomain, getDomainName, getId, getLock, getMaxRevisionNumber, getModifiedDate, getName, getOfflineDate, getOnlineDate, getParent, getParentId, getPermissions, getRevision, getRevisionNumber, isLatestRevision, isOnline, isPublishedRevision, setAttribute, setAuthorName, setComment, setId, setModifiedDate, setName, setOfflineDate, setOnlineDate, setParent, setParentId, setRevisionNumber |
| Methods inherited from class org.liquidsite.core.content.PersistentObject |
decodeMap, delete, delete, encodeMap, getContentManager, hasAdminAccess, hasPublishAccess, hasReadAccess, hasWriteAccess, isPersistent, restore, restore, save, save, validateChars, validateSize |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ContentFile(ContentManager manager,
Content parent,
java.lang.String name)
throws ContentException
manager - the content manager to useparent - the parent content objectname - the file name
ContentException - if the database couldn't be accessed
properly
protected ContentFile(ContentManager manager,
ContentData data,
DataSource src)
throws ContentException
manager - the content manager to usedata - the content data objectsrc - the data source to use
ContentException - if the database couldn't be accessed
properly| Method Detail |
public static java.lang.String getMimeType(javax.servlet.ServletContext context,
java.lang.String fileName)
context - the servlet contextfileName - the file name
public java.lang.String toString()
toString in class Content
public java.io.File getFile()
throws ContentException
ContentException - if the content base directory wasn't
found or couldn't be createdpublic java.lang.String getFileName()
public void setFileName(java.lang.String name)
throws ContentException
name - the new file name
ContentException - if the content base directory wasn't
found or couldn't be createdgetFile()public java.lang.String getMimeType(javax.servlet.ServletContext context)
context - the servlet context
public java.lang.String getTextContent(javax.servlet.ServletContext context)
throws ContentException
context - the servlet context (for the MIME type)
ContentException - if the file data couldn't be read
properly
public void setTextContent(java.lang.String content)
throws ContentException
content - the new file contents
ContentException - if the file data couldn't be written
properly
public void deleteRevision(User user)
throws ContentException,
ContentSecurityException
deleteRevision in class Contentuser - the user performing the operation
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the user specified didn't
have write permissions
protected void doValidate()
throws ContentException
doValidate in class ContentContentException - if the object data wasn't valid
protected void doUpdate(DataSource src,
User user)
throws ContentException
doUpdate in class Contentsrc - the data source to useuser - the user performing the operation
ContentException - if the object data didn't validate or
if the database couldn't be accessed properly
protected void doDelete(DataSource src,
User user)
throws ContentException
doDelete in class Contentsrc - the data source to useuser - the user performing the operation
ContentException - if the database couldn't be accessed
properly
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||