public class FileDocument extends Content implements StrongLockable
Modifier and Type | Class and Description |
---|---|
static class |
FileDocument.AssociatedFileFilter
Filter files against a FileDocument instance to retrieve only
File which are associated to the specified FileDocument (PDF file, txt file, thumbnail etc).
|
static class |
FileDocument.ContentTypeComparator<T extends FileDocument> |
static class |
FileDocument.ContentTypeSelector
This DataSelector selects all the FileDocument matching the given
content type.
|
static class |
FileDocument.DeleteThumbnailListener |
static class |
FileDocument.DimensionsComparator<T extends FileDocument>
This comparators compare FileDocuments of image file type according
to their dimensions.
|
static class |
FileDocument.DurationComparator<T extends FileDocument>
This comparators compare FileDocuments of audio file type according
to their duration.
|
static class |
FileDocument.HiddenSelector
This DataSelector selects all the Hidden FileDocument
|
static class |
FileDocument.MediaTypeSelector
This DataSelector selects all the FileDocument corresponding
to the given media type.
|
static class |
FileDocument.SizeComparator<T extends FileDocument> |
static class |
FileDocument.SizeSelector
This DataSelector selects all the FileDocument in the given range size.
|
Publication.AdateComparator<T extends Publication>, Publication.AdateSelector, Publication.AudienceRightComparator<T extends Publication>, Publication.AudienceRightSelector, Publication.AuthorComparator<T extends Publication>, Publication.AuthorizedSelector, Publication.CanWorkOnSelector, Publication.DdateComparator<T extends Publication>, Publication.EdateComparator<T extends Publication>, Publication.EdateSelector, Publication.PdateComparator<T extends Publication>, Publication.PdateSelector, Publication.PopularityComparator<T extends Publication>, Publication.PstatusComparator<T extends Publication>, Publication.PstatusSelector, Publication.ReaderComparator<T extends Publication>, Publication.ReadRightSelector, Publication.RightComparator<T extends Publication>, Publication.SdateComparator<T extends Publication>, Publication.SdateSelector, Publication.TitleComparator<T extends Publication>, Publication.TrackedSelector, Publication.TypeComparator<T extends Publication>, Publication.UdateComparator<T extends Publication>, Publication.UdateSelector, Publication.UserContentSelector, Publication.VisibleStateSelector, Publication.VoteScoreComparator<T extends Publication>, Publication.WorkspaceAuthorSelector, Publication.WorkspaceComparator<T extends Publication>, Publication.WorkspaceSelector
Data.AuthorSelector, Data.CdateSelector, Data.DataNameComparator<T extends Data>, Data.DeletableSelector, Data.ImportSelector, Data.MdateSelector, Data.OpAuthorComparator<T extends Data>, Data.RowIdComparator<T extends Data>, Data.StrongLockSelector
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contentType |
static java.lang.String |
DEFAULT_DETAIL_VIEW_PROP |
protected static Workflow |
DEFAULT_WORKFLOW |
protected java.lang.String |
description |
protected java.util.HashMap<java.lang.String,java.lang.String> |
descriptionML |
protected java.lang.String |
filename |
static int |
HIDDEN_PSTATUS |
static boolean |
isDefaultDetailView |
static java.lang.String |
OPENOFFICE_MIMETYPE |
static java.lang.String |
OPENXML_PRESENTATION_MIMETYPE |
protected java.lang.String |
originalFilename |
protected java.util.Date |
pdfUploadDate |
static java.lang.String |
REVISION |
static java.lang.String |
THUMBNAIL_PREFIX |
static java.lang.String |
THUMBNAIL_REGEXP |
protected java.util.Date |
uploadDate |
adate, allCatIdSet, authGrpIdSet, authGrpIdSetDirty, authGrpIdSetInit, authMbrIdSet, authMbrIdSetDirty, authMbrIdSetInit, authorizedGroupSet, authorizedMemberSet, categories, categorySet, catIdSet, catIdSetDirty, catIdSetInit, CTRL_TOPIC_ADVANCED, CTRL_TOPIC_CATEGORIES, CTRL_TOPIC_WORKFLOW, edate, friendlyURLSet, hasNoReadRightsDBData, indexMgr, isTracked, mainInstance, mainLanguage, majorVersion, mergeDate, mergeId, minorVersion, pdate, pstatus, PUBLICATION_WFNOTE, readerCount, roleMap, sdate, templates, title, titleML, udate, updateGroupSet, updateMemberSet, voteCount, voteScore, wfExpressAlarmEntry, wfReminderAlarmEntry, workflowId, workspace
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate
IMPORT_ALARM_MGR, IMPORT_AUTHOR_PROP, IMPORT_CATEGORY_DEFAULT, IMPORT_DC_ATTR, IMPORT_DC_STEP, IMPORT_DIR, IMPORT_ENABLED, IMPORT_JDOM_ELEMENT, IMPORT_LOG_FILE, IMPORT_LOG_MAX, IMPORT_OPTIONS, IMPORT_OPTIONS_DC_CONTEXT, IMPORT_ROOT_PROP, IMPORT_SOURCE_FILE, IMPORT_SOURCE_PREFIX_PROP, IMPORT_SOURCES_DIR, IMPORT_STEP_CLEAN, IMPORT_STEP_IMPORT, IMPORT_STEP_UPDATE_REF, IMPORT_WS_PROP
DATA_TAG, DATASET_TAG, FIELD_CLASS, FIELD_ENTRY, FIELD_ITEM, FIELD_KEY, FIELD_NAME, FIELD_TAG, FIELD_VALUE, FILE_FIELD, FILE_ID, FILE_MTIME, FILE_SIZE, FILE_TAG, FILE_TICKET, FILESET_TAG, RELATED_TAG
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
FileDocument() |
FileDocument(FileDocument other) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeReadBy(Group group)
Checks if a group can read this publication.
|
boolean |
canCreateCopy(Member mbr,
boolean isWorkCopy)
This method override canCreateCopy() and returns true for workCopy
and false otherwise (2 FileDocuments cannot target the same file)
|
ControllerStatus |
checkIntegrity()
Checks whether or not data integrity constraints are respected.
|
void |
clearInternalCache()
Clear internal cache of this FileDocument.
|
java.lang.String |
computeSignature(boolean includePublicationFields,
boolean hash)
Compute the signature of this publication.
|
java.util.Set<java.io.File> |
deleteAssociatedFiles()
Delete all the File associated to this FileDocument.
|
boolean |
deleteAssociatedPDF()
Delete the associated PDF to the current file.
|
boolean |
deleteThumbnails()
Delete every thumbnail of this FileDocument if there are any.
|
static boolean |
deleteThumbnails(java.io.File originalFile)
Delete every thumbnail associated to this FileDocument if there are any.
|
static long |
directoryToFileDocuments(java.io.File dir,
java.io.FileFilter filter,
FileDocument refFileDoc,
Member opAuthor,
java.util.Map<java.lang.String,? extends java.lang.Object> contextMap)
Create FileDocumens from all files in the specified directory (and its sub directory).
|
void |
discardCopy(Publication copy)
This method is called when the creation of copy or a work copy of this publication has failed.
|
void |
exportXmlField(java.lang.StringBuffer sb,
int indentLevel)
Fills the given StringBuffer with Xml export of fields of this data.
|
java.lang.String |
getAbstract()
Returns the abstract of this publication in the channel's main language.
|
java.lang.String |
getAbstract(java.lang.String lang,
boolean useDefault)
Retrieve the value of this FileDocument's abstract field (description)
in the specified language.
|
java.lang.String |
getAccessibilityInformation(java.util.Locale locale,
boolean htmlDisplay)
Returns a formatted string displaying accesibility information.
|
java.util.Set<java.lang.String> |
getAllFilePath()
Gives the set of all relatives path to all kind (image, media, file) of files linked
from the given publication.
|
java.lang.String |
getAllWikiText()
Retrieve a String containing all the wiki text available for this FileDocument.
|
java.util.Set<java.io.File> |
getAssociatedFileSet()
Retrieve a Set of File associated to this FileDocument.
|
java.io.File |
getAssociatedPDF()
Returns the pdf associated with a FileDocument.
|
static java.util.Comparator<FileDocument> |
getComparator(java.lang.String str,
boolean reverse)
Deprecated.
|
java.lang.String |
getContentType() |
static <T extends FileDocument> |
getContentTypeComparator() |
java.lang.String |
getDataIcon()
Returns source information for the icon associated to this Data, either a relative path or sprite classes name.
|
java.lang.String |
getDataIconTitle(java.lang.String lang)
Returns the icon's tooltip.
|
java.lang.String |
getDataImage()
Retrieves the image path of this data in the channel's main language.
|
java.lang.String |
getDataImage(java.lang.String lang,
boolean useDefault)
Retrieves the image path of this data.
|
static java.lang.String |
getDefaultContentType() |
static Workflow |
getDefaultWorkflow()
Returns the Default Workflow associated with FileDocument
|
java.lang.String |
getDescription() |
java.lang.String |
getDescription(java.lang.String lang) |
java.lang.String |
getDescription(java.lang.String lang,
boolean useDefault) |
java.util.HashMap<java.lang.String,java.lang.String> |
getDescriptionML() |
java.lang.String |
getDimensions()
Returns the dimensions of the image in the following
form: "{width}×{height}" (withouth quotes).
|
static <T extends FileDocument> |
getDimensionsComparator() |
long |
getDuration()
Returns the duration of the audio (reserved for audio files)
|
static <T extends FileDocument> |
getDurationComparator() |
java.lang.String |
getExportXmlDataValue()
Returns a string representation of this data used by exportXml().
|
static java.lang.String |
getExtension(java.lang.String filename)
This method return the lowercase extension of a given file name
it return string after last '.' of the filename.
|
java.lang.Object |
getFieldValue(java.lang.String fieldName,
java.lang.String lang,
boolean useDefault)
Gets the
Object value of the given field name for this FileDocument . |
java.io.File |
getFile()
Returns the File object for the corresponding the filename
|
static FileDocument |
getFileDocumentFromFile(java.io.File file)
Retrieves the first FileDocument bound to the given File.
|
static FileDocument |
getFileDocumentFromFilename(java.lang.String filename)
Retrieves the first FileDocument bound to the given filename.
|
static java.io.File |
getFileFromThumbnail(java.io.File thumbnailFile)
Retrieve the original File associated with the given thumbnail File.
|
java.util.Date |
getFileIndexingDate() |
java.lang.String |
getFilename()
Retrieve the path relative to the webapp of the file
pointed by this FileDocument.
|
<T extends Data> |
getFileReferrerSet(java.lang.Class<T> clazz)
Returns all the data referring the file of this FileDocument (except this FileDocument itself).
|
java.lang.String |
getGenericContentType()
Returns the generic content-type of this FileDocument
(eg "video" if content-type contains "video/mpeg").
|
java.lang.String |
getGenericThumbnail()
Returns a generic thumbnail for this FileDocument.
|
long |
getHeight()
Retrieve the height of the image represented by this filedoc.
|
static FileDocument.HiddenSelector |
getHiddenSelector() |
java.lang.String |
getIcon() |
java.util.Date |
getIndexedDate()
Deprecated.
|
static FileDocument |
getInstance(java.lang.Class<? extends FileDocument> clazz,
java.lang.String filename,
java.lang.String title,
java.lang.String description,
Category[] categories,
Member author,
Workspace ws)
Constructs a FileDocument from an existing file for the given class.
|
static FileDocument |
getInstance(java.lang.String filename)
Constructs a FileDocument from an existing file.
|
static FileDocument |
getInstance(java.lang.String filename,
Member author,
Workspace ws)
Constructs a FileDocument from an existing file.
|
static FileDocument |
getInstance(java.lang.String filename,
java.lang.String title,
java.lang.String description,
Category[] categories)
Constructs a FileDocument from an existing file.
|
static FileDocument |
getInstance(java.lang.String filename,
java.lang.String title,
java.lang.String description,
Category[] categories,
Member author,
Workspace ws)
Constructs a FileDocument from an existing file.
|
long |
getLastModified()
Returns the time that this filedocument was last modified.
|
static java.util.Set<FileDocument> |
getLockedDocumentSet(Workspace ws,
Member mbr)
Returns the set of FileDocument which have a strong lock.
|
org.apache.lucene.document.Document |
getLuceneDocument()
Return the Lucene Document bound to this FileDocument.
|
java.lang.String |
getMediaType()
Retrieves the media type of this FileDocument as a String.
|
static FileDocument.MediaTypeSelector |
getMediaTypeSelector(java.lang.String mediaType) |
java.lang.String |
getMetaData(java.lang.String tag)
Returns the value bound to the given metadata
|
java.util.Map<java.lang.String,java.lang.String> |
getMetaDataMap()
Returns the map of metadata
|
static java.lang.String[] |
getNewDocumentDirectoryAndName(java.lang.String fileName,
java.lang.String contentType)
Retrieves the file's name and the relative path of the directory to use
for creation of a new FileDocument for the given file's name.
|
static java.lang.String |
getNewDocumentFilename(java.lang.String fileName)
Retrieves the relative path (==filename) to use for creation of a
new FileDocument for the given file's name.
|
static java.lang.String |
getOriginalDocumentFromPDF(java.lang.String pdfFilename)
Returns the filename of the original document bound to the given PDF filename otherwise returns null.
|
java.lang.String |
getOriginalFilename() |
java.util.Date |
getPdfUploadDate()
Returns the date at which the Associated PDF file was uploaded (if uploaded by user).
|
static java.lang.String |
getQualifiedName(java.lang.String filename)
This method return the name of a given file without the extension.
|
static java.lang.String |
getRealContentType(java.lang.String contentType,
java.lang.String extension)
This method retrieve the real content type from a given one.
|
java.lang.String[] |
getSearchStrings()
Retrieve an array of String containing all the text that may be searched.
|
long |
getSize()
Returns the size of the file encapsulated by this FileDocument.
|
static <T extends FileDocument> |
getSizeComparator() |
static java.io.File |
getThumbnailFile(java.io.File file,
int maxWidth,
int maxHeight)
Gets the File to use for a thumbnail of the given image file, using given dimensions.
|
static java.lang.String |
getThumbnailFilename(java.lang.String originalFilename,
int maxWidth,
int maxHeight)
Returns the file name of the thumbnail to create given an original filename
Uses the following format for the new filename: th-{maxWidth}x{maxHeight}-{originalFilename}.jpg |
java.lang.String |
getTypeInfo(java.lang.String lang)
Returns the information bound to the type this FileDocument
|
java.util.Date |
getUploadDate()
Returns the date of the last upload.
|
java.util.Set<Publication> |
getWeakReferrerSet()
Returns the set of weak referrers.
|
long |
getWidth()
Retrieve the width of the image represented by this filedoc.
|
boolean |
hasStrongLock()
Deprecated.
|
void |
importXml(org.jdom.Element elt,
ImportOptions options)
Fill this data with the values contains in the JDOM element.
|
protected void |
importXmlFieldsWithReferences(org.jdom.Element elt,
ImportOptions options) |
void |
initCopy(Member newAuthor)
Initialize this publication once it has been cloned for a copy
(eg by duplicate.jsp)
|
protected boolean |
internalCanBeReadBy(Member member,
boolean searchInGroups,
RightInfo rightInfo) |
boolean |
isAudio()
Returns true if this FileDocument is an audio file.
|
boolean |
isDefaultDetailView()
Returns true if this FileDocument must be viewed in detail by default.
|
boolean |
isFlash()
Returns true if this FileDocument is a flash file.
|
static boolean |
isGeneratedPDF(java.lang.String filename)
Returns true if the given filename is a PDF file generated with JCMS Universal.
|
static boolean |
isGenericContentType(java.lang.String contentType) |
boolean |
isImage()
Returns true if this FileDocument is an image.
|
boolean |
isIndexed() |
boolean |
isMedia()
Check if this FileDocument is a media file (ie : an image, audio, video or flash file)
|
boolean |
isText()
Returns true if this FileDocument is a text file.
|
static boolean |
isThumbnail(java.io.File file)
Returns true if the given file is a thumbnail.
|
boolean |
isVideo()
Returns true if this FileDocument is a video file.
|
boolean |
isWebImage()
Returns true if this FileDocument contains an image displayable
in a Web browser (i.e.
|
protected void |
performAfterWrite(int op,
Member mbr,
java.util.Map context)
Called to perform some action after the write.
|
void |
performDelete(Member mbr,
java.util.Map context)
Performs data deletion
|
void |
performUpdate(Member mbr,
java.util.Map context)
Performs data update
|
void |
setContentType(java.lang.String v) |
void |
setDescription(java.lang.String v) |
void |
setDescription(java.lang.String lang,
java.lang.String value)
Convenient method to set the value of the Description field
in any language (default site language or any other).
|
void |
setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> v) |
void |
setFieldValue(java.lang.String fieldName,
java.lang.Object value,
java.lang.String lang)
Sets the value of the given
Object field name for the current Data . |
void |
setFilename(java.lang.String v) |
void |
setOriginalFilename(java.lang.String v) |
void |
setPdfUploadDate(java.util.Date date)
Set the date at which the Associated PDF file was uploaded (if uploaded by user).
|
void |
setUploadDate(java.util.Date date)
Set the date of the last upload.
|
boolean |
supportsThumbnail()
Returns true if a thumbnail can be generated for this document.
|
static long |
unzipToFileDocuments(java.io.File zipFile,
java.io.FileFilter filter,
FileDocument refFileDoc,
Member opAuthor)
Unzip the specified File to n new FileDocument.
|
long |
unzipToFileDocuments(java.io.FileFilter filter,
Member opAuthor)
Unzip this FileDocument to n FileDocument.
|
addAuthorizedGroup, addAuthorizedMember, addCategory, addFollower, addWeakReferrer, addWFExpressAlarm, addWFReminderAlarm, assignCommonPublicationFields, assignRole, assignRole, canBeArchived, canBeArchived, canBeEditedFieldByField, canBeFollowedBy, canBeReadBy, canBeReadBy, canBeReadBy, canBeReadBy, canBeVotedBy, canCreateCopy, canCreateWorkCopy, canMergeWorkCopy, canRequestUnlock, checkCreate, checkDelete, checkLang, checkMember, checkMerge, checkStateChange, checkStateChange, checkTemplateEntry, checkUpdate, checkWrite, clearTransientIndex, cloneDBDataCollections, computeSignature, containsCategory, createCopy, createWFNote, createWFNote, createWorkCopy, getAbstract, getAbstractML, getAccessCount, getAdate, getAdateComparator, getAdateSelector, getAllCatIdSet, getAllWysiwygText, getAudiencedRightsString, getAudienceRightComparator, getAudienceRightSelector, getAuthGrpIdSet, getAuthMbrIdSet, getAuthorizedGroupSet, getAuthorizedMemberSet, getAuthorizedSelector, getCanWorkOnSelector, getCategories, getCategories, getCategorySet, getCatIdSet, getComparator, getComparator, getCSVHeader, getDataName, getDate, getDate, getDateSelector, getDBDataRevision, getDdateComparator, getDefaultTemplateUsage, getDescendantCategorySet, getDescendantCategorySet, getDescendantCategorySet, getDisplayTemplateFile, getDocumentLinkSet, getEdate, getEdateComparator, getEdateSelector, getEstimatedReminderCount, getExternalLinkSet, getFieldInMainLanguage, getFirstDescendantCategory, getFirstDescendantCategory, getFirstDescendantCategory, getFollowerList, getFriendlyURLSet, getHasNoReadRights, getImportConflictCopy, getImportVersion, getIndexingDate, getInternalWorkflow, getLinkDataSet, getMainInstance, getMainLanguage, getMajorVersion, getMemberSetAssignedToRole, getMergeDate, getMergeId, getMinorVersion, getNextWFStateSet, getPdate, getPdateComparator, getPdateSelector, getPopularity, getPopularityComparator, getPstatus, getPstatusAlarmEntry, getPstatusComparator, getPstatusSelector, getPstatusSelector, getQueryTemplateFile, getReaderComparator, getReaderCount, getReaderTrackerList, getReadRightSelector, getReadRightsString, getRightComparator, getRoleMap, getRoleMapStr, getSdate, getSdateComparator, getSdateSelector, getTemplate, getTemplateEntry, getTemplateEntry, getTemplateEntrySet, getTemplatePath, getTemplatePath, getTemplates, getTitle, getTitle, getTitle, getTitleComparator, getTitleComparator, getTitleML, getTrackedSelector, getTreeChildren, getTreeParent, getTreeRoot, getTypeComparator, getTypeLabel, getUdate, getUdateComparator, getUdateSelector, getUpdateGroupSet, getUpdateMemberSet, getVersionString, getVisibleStateSelector, getVoteCount, getVoteScore, getVoteScoreComparator, getVoteValue, getWFNoteList, getWFState, getWFStateLabel, getWFStateLabelHtml, getWorkCopySet, getWorkflow, getWorkflowId, getWorkspace, getWorkspaceAuthorSelector, getWorkspaceComparator, getWorkspaceId, getWorkspaceSelector, getWSTypeEntry, getWSTypeEntry, hasAlreadyVoted, hasAnyReadRights, hasBeenReadBy, hasCategory, hasImportConflict, hasNoReadRights, hasWeakReferrers, importConvertToLocal, importMarkAsMerged, importOverrideAndUpdate, init, initializeDBDataCollections, isAudienced, isDefaultTemplate, isFollowedBy, isImportConflictCopy, isInRole, isInVisibleState, isPublic, isRoleAssigned, isTracked, isTreeLeaf, isTreeNode, isUserContent, isUserContentType, isVersioned, isVotable, isWorkCopy, majorUpdate, notifyFollowers, performBeforeWrite, performCreate, performMerge, performMerge, prepareMergeCopy, putPstatusAlarmEntry, recomputeScore, removeAllDescendants, removeAllFollowers, removeAllReaderTracker, removeAuthorizedGroup, removeAuthorizedMember, removeCategory, removeDataSet, removeFollower, removeImportMetadata, removePstatusAlarmEntry, removeWeakReferrer, removeWFExpressAlarm, removeWFReminderAlarm, resolveTypeTemplateEntry, setAbstract, setAbstract, setAdate, setAllCatIdSet, setAuthGrpIdSet, setAuthMbrIdSet, setAuthorizedGroupSet, setAuthorizedMemberSet, setCategories, setCategorySet, setCatIdSet, setCdate, setEdate, setFriendlyURLSet, setHasNoReadRights, setImportConflictCopy, setImportVersion, setMainInstance, setMainLanguage, setMajorVersion, setMergeDate, setMergeId, setMinorVersion, setPdate, setPstatus, setReaderCount, setRoleMap, setRoleMapStr, setRoleMemberSetMap, setSdate, setTemplate, setTemplates, setTitle, setTitle, setTitleML, setTracked, setUdate, setUpdateGroupSet, setUpdateMemberSet, setVoteCount, setVoteScore, setWorkflow, setWorkflowId, setWorkspace, setWorkspaceId, toCSV, toFullString, toString, trackReader, trackReader, unassignMember, unassignRole, updatePstatus, updateTemplate
checkCreate, checkDelete, checkIntegrity, checkLockMember, checkStrongLockMember, checkUpdate, clone, computeDBIDArray, exportXml, exportXml, exportXml, exportXml, exportXmlRelated, exportXmlRelated, fillExportXmlFieldAttributes, getAllReferrerSet, getAllReferrerSet, getAllTypeFieldEntry, getAuthor, getAuthor, getAuthorComparator, getAuthorDBID, getAuthorId, getAuthorSelector, getBooleanFieldValue, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCategoryFieldValue, getCdateSelector, getDataIconAlt, getDataIconHtml, getDataIconHtml, getDataImage, getDataNameComparator, getDeletableSelector, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayUrl, getDoubleFieldValue, getDoubleFieldValue, getExtension, getExtraData, getExtraDataMap, getExtraDBData, getExtraDBDataMap, getExtraInfo, getExtraInfoMap, getFieldStatusMap, getFieldValue, getFieldValue, getFieldValue, getImportAuthor, getImportBatch, getImportDate, getImportDisplayUrl, getImportId, getImportMap, getImportMdate, getImportSelector, getImportSignature, getImportSource, getImportSourceUrl, getImportUrl, getIntFieldValue, getIntFieldValue, getLangPropertyValue, getLinkCount, getLinkIndexedDataSet, getLinkIndexedDataSet, getLockDate, getLockInfo, getLockMember, getLongFieldValue, getLongFieldValue, getMdateSelector, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getOpAuthor, getOpAuthorComparator, getOpDelegate, getRowId, getRowIdComparator, getStrongLock, getStrongLockDate, getStrongLockInfo, getStrongLockMember, getStrongLockSelector, getTypeEntry, getTypeFieldsEntries, getUpdateInstance, getVirtualIDSet, hashCode, importXmlFiles, importXmlReferences, isDBData, isImported, isImportUpdated, isInDatabase, isLocked, isPersisted, isStrongLocked, lock, markNewImport, mergeHybridLink, performCreate, performDelete, performUpdate, prepareUpdateContext, printDataName, printDisplayLinkEnd, printDisplayLinkStart, printDisplayUrl, printDisplayUrl, putStrongLock, releaseStrongLock, releaseStrongLock, removeExtraData, removeExtraDBData, removeExtraInfo, setAuthor, setAuthorDBID, setAuthorId, setBooleanFieldValue, setCategoryFieldValue, setDoubleFieldValue, setExtension, setExtraData, setExtraDataMap, setExtraDBData, setExtraDBDataMap, setExtraDBDataMap, setExtraInfo, setFieldValue, setImportAuthor, setImportBatch, setImportDate, setImportDisplayUrl, setImportId, setImportMap, setImportMdate, setImportSignature, setImportSource, setImportSourceUrl, setImportUpdated, setIntFieldValue, setLongFieldValue, setMdate, setOpAuthor, setOpDelegate, setRowId, unlock, unlock, unmarkNewImport, updateExtraDataMap, updateExtraDBDataMap, updateIndexTreeSet
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, isStored, resolveAtt, resolveVal, setAttributes, setAttributes, setDdate, setId, setStore, toXml
public static final java.lang.String REVISION
public static final int HIDDEN_PSTATUS
public static final java.lang.String THUMBNAIL_PREFIX
public static final java.lang.String THUMBNAIL_REGEXP
protected static Workflow DEFAULT_WORKFLOW
public static final java.lang.String OPENXML_PRESENTATION_MIMETYPE
public static final java.lang.String OPENOFFICE_MIMETYPE
public static final java.lang.String DEFAULT_DETAIL_VIEW_PROP
public static final boolean isDefaultDetailView
protected java.lang.String description
protected java.util.HashMap<java.lang.String,java.lang.String> descriptionML
protected java.lang.String filename
protected java.lang.String originalFilename
protected java.lang.String contentType
protected java.util.Date uploadDate
protected java.util.Date pdfUploadDate
public FileDocument()
public FileDocument(FileDocument other)
public static FileDocument getInstance(java.lang.String filename)
filename
- the filename. It must be relative to the context pathpublic static FileDocument getInstance(java.lang.String filename, Member author, Workspace ws)
filename
- the filename. It must be relative to the context pathauthor
- the author of the document or nullws
- the workspace of the publicationpublic static FileDocument getInstance(java.lang.String filename, java.lang.String title, java.lang.String description, Category[] categories)
filename
- the filename. It must be relative to the context pathtitle
- a proposed title (if null, use the name without its extension as title)description
- the description (may be null)categories
- the categories (may be null)public static FileDocument getInstance(java.lang.String filename, java.lang.String title, java.lang.String description, Category[] categories, Member author, Workspace ws)
filename
- the filename. It must be relative to the context pathtitle
- a proposed title (if null, use the name without its extension as title)description
- the description (may be null)categories
- the categories (may be null)author
- the author of the document or nullws
- the workspace of the publicationpublic static FileDocument getInstance(java.lang.Class<? extends FileDocument> clazz, java.lang.String filename, java.lang.String title, java.lang.String description, Category[] categories, Member author, Workspace ws)
clazz
- the FileDocument class to instanciatefilename
- the filename. It must be relative to the context pathtitle
- a proposed title (if null, use the name without its extension as title)description
- the description (may be null)categories
- the categories (may be null)author
- the author of the document or nullws
- the workspace of the publicationpublic java.lang.Object getFieldValue(java.lang.String fieldName, java.lang.String lang, boolean useDefault) throws java.lang.NoSuchFieldException
Object
value of the given field name for this FileDocument
. getFieldValue
in class Publication
fieldName
- the field name from which to retrieve the field value.lang
- the language (ISO-639 code) in which to retrieve the field value
(used only for multilingual fields).useDefault
- whether to use the publication main language if the field value
is not available in the requested language (used only for multilingual fields).Object
field valuejava.lang.NoSuchFieldException
- if the field was not found in the given Publication
.public void setFieldValue(java.lang.String fieldName, java.lang.Object value, java.lang.String lang) throws java.lang.NoSuchFieldException
Object
field name for the current Data
. Category
fields, see #getCategoryFieldValue(String, Member).setFieldValue
in class Publication
fieldName
- the field name from which to retrieve the field value.value
- whether to use the publication main language if the field value
is not available in the requested language (used only for multilingual fields).lang
- the language (ISO-639 code) in which to retrieve the field value
(used only for multilingual fields).java.lang.NoSuchFieldException
- if the field was not found in the given Data
.public java.lang.String getAbstract()
Publication
getAbstract
in class Publication
public java.lang.String getAbstract(java.lang.String lang, boolean useDefault)
getAbstract
in class Publication
lang
- the language (ISO 639: 2-letter codes) in which to
retrieve the field value.useDefault
- whether to use the publication main language if the field value
is not available in the requested language.public java.lang.String getDataImage()
Data
This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.
getDataImage
in class Data
public java.lang.String getDataImage(java.lang.String lang, boolean useDefault)
Data
This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.
getDataImage
in class Data
lang
- the user language (ISO-639 language code)useDefault
- should the default language be used if no value is found for the specified languagepublic java.lang.String getAllWikiText()
getAllWikiText
in class Publication
public void importXml(org.jdom.Element elt, ImportOptions options)
Data
importXml
in class Publication
elt
- the JDOM elementoptions
- the ImportOptionsprotected void importXmlFieldsWithReferences(org.jdom.Element elt, ImportOptions options)
importXmlFieldsWithReferences
in class Data
public java.lang.String getExportXmlDataValue()
getExportXmlDataValue
in class Data
public void exportXmlField(java.lang.StringBuffer sb, int indentLevel)
Data
exportXmlField
in class Publication
sb
- the StringBufferindentLevel
- the indent levelpublic java.lang.String[] getSearchStrings()
getSearchStrings
in interface Searchable
getSearchStrings
in class Publication
Searchable.getSearchStrings()
public void clearInternalCache()
You might need to invoke this method after modification to the file without update of the FileDocument (this is not recommended though).
public boolean isDefaultDetailView()
public java.io.File getFile()
public long getSize()
public long getLastModified()
public java.lang.String getIcon()
public java.lang.String getDataIcon()
Data
If this method behavior has not been overriden by subclass, the default icon can be declared
using property types.{Type}.icon
, where {Type}
is the short class name of
the type concerned.
types.Article.icon: images/jalios/icon/abstract.gif
types.Article.icon: ss_sprite ss_date
getDataIcon
in class Publication
images/jalios/icon/abstract.gif
) or sprite classes name (eg ss_sprite ss_date
).Data.getDataIconHtml(String)
public java.lang.String getDataIconTitle(java.lang.String lang)
Data
If this method behavior has not been overriden by subclass, the default alternative text can be declared
using language property types.{Type}.title
, where {Type}
is the short class name of
the type concerned.
getDataIconTitle
in class Publication
lang
- the user language.Data.getDataIconHtml(String)
public java.lang.String getGenericContentType()
public long getWidth()
public long getHeight()
public java.lang.String getDimensions()
public long getDuration()
AudioUtil.getDuration(File)
public boolean isWebImage()
public boolean isImage()
public boolean isAudio()
public boolean isVideo()
public boolean isText()
public boolean isFlash()
public boolean isMedia()
public java.lang.String getMediaType()
public boolean isIndexed()
@Deprecated public java.util.Date getIndexedDate()
getFileIndexingDate()
public java.util.Date getFileIndexingDate()
public org.apache.lucene.document.Document getLuceneDocument()
public java.lang.String getTypeInfo(java.lang.String lang)
lang
- the user languagepublic java.util.Set<Publication> getWeakReferrerSet()
Publication
getWeakReferrerSet
in class Publication
public <T extends Data> java.util.Set<T> getFileReferrerSet(java.lang.Class<T> clazz)
T
- A data classclazz
- the class for filter with.
Returns all the data referring the file of this FileDocument (except this FileDocument itself).public java.lang.String getMetaData(java.lang.String tag)
tag
- the name of the metadata to getpublic java.util.Map<java.lang.String,java.lang.String> getMetaDataMap()
public boolean canCreateCopy(Member mbr, boolean isWorkCopy)
canCreateCopy
in class Publication
mbr
- the member to be checkedisWorkCopy
- true if this is a workCopyPublication.canCreateCopy(com.jalios.jcms.Member,boolean)
public void initCopy(Member newAuthor)
Publication
initCopy
in class Publication
newAuthor
- the author of this publicationpublic void discardCopy(Publication copy)
Publication
discardCopy
in class Publication
copy
- the copy which has been discarded.protected boolean internalCanBeReadBy(Member member, boolean searchInGroups, RightInfo rightInfo)
internalCanBeReadBy
in class Publication
public boolean canBeReadBy(Group group)
Publication
canBeReadBy
in class Publication
group
- the group to checkpublic java.lang.String getDescription(java.lang.String lang)
public java.lang.String getDescription(java.lang.String lang, boolean useDefault)
public java.lang.String getDescription()
public void setDescription(java.lang.String v)
public java.util.HashMap<java.lang.String,java.lang.String> getDescriptionML()
public void setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> v)
public void setDescription(java.lang.String lang, java.lang.String value)
setDescription(String)
or setDescriptionML(HashMap)
)
depending on the specified language.lang
- the language (ISO 639 code) in which to set the valuevalue
- the value to set.public java.lang.String getFilename()
upload/docs/image/jpg/welcome.gif
It should not start with a slash ("/").public void setFilename(java.lang.String v)
public java.lang.String getOriginalFilename()
public void setOriginalFilename(java.lang.String v)
public java.lang.String getContentType()
public void setContentType(java.lang.String v)
public java.util.Date getUploadDate()
public void setUploadDate(java.util.Date date)
date
- the date.public java.util.Date getPdfUploadDate()
public void setPdfUploadDate(java.util.Date date)
date
- the Date of the Associated PDF file upload (null to indicated PDF was not uploaded by user)@Deprecated public boolean hasStrongLock()
Data.isStrongLocked()
public static java.util.Set<FileDocument> getLockedDocumentSet(Workspace ws, Member mbr)
ws
- the workspacembr
- the member who performs this request (to check read rights)public java.io.File getAssociatedPDF()
public boolean deleteAssociatedPDF()
public static boolean isGeneratedPDF(java.lang.String filename)
filename
- the filename to be checkedpublic static java.lang.String getOriginalDocumentFromPDF(java.lang.String pdfFilename)
pdfFilename
- the filename of a PDF file generated with JCMS Universalpublic java.util.Set<java.io.File> getAssociatedFileSet()
Implementation note : In order to always return a Set of file
up to date, the file system is read and files are filtered
each time the method is invoked.
Use this method wisely if you need high performance.
FileDocument.AssociatedFileFilter
public java.util.Set<java.io.File> deleteAssociatedFiles()
It includes thumbnails, generated pdf or any other associated file as
defined by properties file-document.associated-files.*
.
The File referenced by this FileDocument is NOT deleted.
FileDocument.AssociatedFileFilter
public java.lang.String getGenericThumbnail()
file-document.thumb.{generic-content-type}
.
If no property was defined for the content type of this FileDocument, the
thumbnail specified in property file-document.thumb.unknown
is used.
getGenericThumbnail
in class Data
images/jalios/icons/media/word.gif
public boolean deleteThumbnails()
deleteThumbnails(File)
public static boolean deleteThumbnails(java.io.File originalFile)
originalFile
- the original file used to produce thumbnailspublic static java.lang.String getThumbnailFilename(java.lang.String originalFilename, int maxWidth, int maxHeight)
originalFilename
- the filename to convert, must not be null or emptymaxWidth
- the maximum width of the thumbnail, a positive integer.maxHeight
- the maximum height of the thumbnail, a positive integer.public static java.io.File getThumbnailFile(java.io.File file, int maxWidth, int maxHeight)
file
- the file from which to get and create the associated thumbnail File, cannot be null.maxWidth
- the maximum width of the thumbnail, a positive integer.maxHeight
- the maximum height of the thumbnail, a positive integer.getThumbnailFilename(String, int, int)
public static java.io.File getFileFromThumbnail(java.io.File thumbnailFile)
getThumbnailFile(File, int, int)
.thumbnailFile
- a File representing the thumbnail.public static boolean isThumbnail(java.io.File file)
file
- the file to be checkedpublic boolean supportsThumbnail()
PolicyManager.supportsThumbnail(FileDocument, boolean)
public static Workflow getDefaultWorkflow()
public static FileDocument getFileDocumentFromFile(java.io.File file)
file
- the File of the FileDocument to be retrieved.getFileDocumentFromFilename(String)
public static FileDocument getFileDocumentFromFilename(java.lang.String filename)
filename
- the filename (relative path such as
"upload/docs/image/gif/welcome.gif"
) of the FileDocument to be retrieved.getFileDocumentFromFile(File)
public static boolean isGenericContentType(java.lang.String contentType)
public static java.lang.String getDefaultContentType()
public static java.lang.String getRealContentType(java.lang.String contentType, java.lang.String extension)
contentType
- the file content typeextension
- the file extensionpublic java.lang.String getAccessibilityInformation(java.util.Locale locale, boolean htmlDisplay)
locale
- the current LocalehtmlDisplay
- if true, uses an html format, with detailed abbreviation, otherwise, use only plain textpublic static java.lang.String getNewDocumentFilename(java.lang.String fileName)
"Présentation finale.ps"
, can return a path
such as "upload/docs/application/postscript/2006/06/presentation-finale.ps"
fileName
- the original name of the file to be added.java.lang.IllegalArgumentException
- if the fileName argument is null.public static java.lang.String[] getNewDocumentDirectoryAndName(java.lang.String fileName, java.lang.String contentType)
"Présentation finale.ps"
, can return a path
such as "upload/docs/application/postscript/2006/06/presentation-finale.ps"
fileName
- the original name of the file to be added. Must not be null.contentType
- the content type of the file or null if not available.java.lang.IllegalArgumentException
- if the fileName argument is null.public static java.lang.String getExtension(java.lang.String filename)
IOUtil.getExtension(String)
is "jsp".filename
- the file nameIOUtil.getExtension(String)
public static java.lang.String getQualifiedName(java.lang.String filename)
filename
- the file namepublic static <T extends FileDocument> java.util.Comparator<T> getContentTypeComparator()
T
- subclass of FileDocumentpublic static <T extends FileDocument> java.util.Comparator<T> getSizeComparator()
T
- subclass of FileDocumentpublic static <T extends FileDocument> java.util.Comparator<T> getDimensionsComparator()
T
- subclass of FileDocumentpublic static <T extends FileDocument> java.util.Comparator<T> getDurationComparator()
T
- subclass of FileDocumentpublic static java.util.Comparator<FileDocument> getComparator(java.lang.String str, boolean reverse)
ComparatorManager
Comparator
given a name representing
it. The returned comparator can be used to sort any
Collection
containing Publication
s.
getContentTypeComparator()
getDimensionsComparator()
getDurationComparator()
getSizeComparator()
Publication.getComparator(String, boolean)
str
- a string representing the comparatorreverse
- a boolean indicating whether the comparator should have
its behavior reversed (true) or unchanged (false)Comparator
.Publication.getComparator(String, boolean)
public static FileDocument.HiddenSelector getHiddenSelector()
public static FileDocument.MediaTypeSelector getMediaTypeSelector(java.lang.String mediaType)
public long unzipToFileDocuments(java.io.FileFilter filter, Member opAuthor)
Newly created FileDocument will have same field value, as copied using
Publication.assignCommonPublicationFields(Publication)
As of current implementation, the unzip operation is performed only if the following conditions match :
"application/zip"
Warning: it can be a time consumming operation, depending on the zip's size.
filter
- an optionnal FileFilter to filter the files
to be extracted and converted to FileDocument.
This filter is also used on extracted directory.opAuthor
- the Member to used to perform the create operationpublic static long unzipToFileDocuments(java.io.File zipFile, java.io.FileFilter filter, FileDocument refFileDoc, Member opAuthor)
Warning: it can be a time consumming operation, depending on the zip's size.
zipFile
- the File to unzipfilter
- an optionnal FileFilter to filter the files
to be extracted and converted to FileDocument.
This filter is also used on extracted directory.refFileDoc
- optionnal FileDocument from which to retrieve fields value to be
assigned to the newly created FileDocuments.
See Publication.assignCommonPublicationFields(Publication)
.opAuthor
- optional (but recommended) Member to used to perform the create operationpublic static long directoryToFileDocuments(java.io.File dir, java.io.FileFilter filter, FileDocument refFileDoc, Member opAuthor, java.util.Map<java.lang.String,? extends java.lang.Object> contextMap)
Warning: it can be a time consumming operation.
dir
- the Directory from which to retrieve Filesfilter
- an optionnal FileFilter to filter the files
to be converted to FileDocument.refFileDoc
- optionnal FileDocument from which to retrieve fields value to be
assigned to the newly created FileDocuments.
See Publication.assignCommonPublicationFields(Publication)
.opAuthor
- optional (but recommended) Member to used to perform the create operationcontextMap
- optional Map to be used during performCreate operation (may be null)public ControllerStatus checkIntegrity()
Publication
checkIntegrity
in class Publication
public void performUpdate(Member mbr, java.util.Map context)
Publication
performUpdate
in class Publication
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public void performDelete(Member mbr, java.util.Map context)
Publication
performDelete
in class Publication
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)protected void performAfterWrite(int op, Member mbr, java.util.Map context)
Data
performAfterWrite
in class Publication
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public java.util.Set<java.lang.String> getAllFilePath()
Publication
getAllFilePath
in class Publication
public java.lang.String computeSignature(boolean includePublicationFields, boolean hash)
Publication
computeSignature
in class Publication
includePublicationFields
- if true add the common publication fields (author, pdate, categories, ...). Computed fields (cdate, mdate, udate, minorVersion) are skipped.hash
- if true hash (MD5) the signature otherwise return the complete string of the signature.Copyright © 2001-2010 Jalios SA. All Rights Reserved.