Class Document
- All Implemented Interfaces:
LocalId
,ContentConstants
,AppianTypeHolder
,Serializable
Document
in the old collaboration API.- See Also:
-
Field Summary
Fields inherited from interface com.appiancorp.suiteapi.content.ContentConstants
ACT_CREATE, ACT_DEACTIVATE, ACT_DELETE, AL_ADMIN, AL_EDITOR, AL_INVALID_ID, AL_NONE, AL_VIEWER, ALLOCATE_FSID, ALLOCATE_GLOBAL_PART, ALLOCATE_PART, APPLICATIONS_ROOT_DESCRIPTION, APPLICATIONS_ROOT_NAME, CHILDREN, COLUMN_ACTION_REQUESTED, COLUMN_ACTION_REQUESTER, COLUMN_ATTRIBUTES, COLUMN_CHANGES_REQUIRE_APPROVAL, COLUMN_CREATED_TIMESTAMP, COLUMN_CREATOR, COLUMN_DESCRIPTION, COLUMN_EXPIRATION_DAYS, COLUMN_EXPIRATION_TIMESTAMP, COLUMN_EXTENSION, COLUMN_FORUM, COLUMN_FSID, COLUMN_FSID_COUNT, COLUMN_ID, COLUMN_LOCKED_BY, COLUMN_LOG, COLUMN_LOG_NAME, COLUMN_METADATA_IDS, COLUMN_NAME, COLUMN_NONE, COLUMN_NUMBER_OF_VERSIONS, COLUMN_PARENT_ID, COLUMN_PARENT_NAME, COLUMN_PARENT_TYPE, COLUMN_PARTITION, COLUMN_PARTITION_NAME, COLUMN_SECURITY, COLUMN_SIZE, COLUMN_STATE, COLUMN_SUBTYPE, COLUMN_TYPE, COLUMN_UPDATED_TIMESTAMP, COLUMN_UUID, COLUMN_VERSION_ID, COLUMN_VERSIONS, COLUMN_VISIBILITY, COMMUNITY_ROOT, CONTENT_SECURITY_TYPE, CREATION_SECURITY_TYPE, FILTER_TYPE_ALL, GC_MOD_DRAFT, GC_MOD_LINKS, GC_MOD_NORMAL, GC_MOD_POPULATE_TYPES_OF_CHILDREN, GC_VERSIONS_AS_FOLDERS, I18N_PREFIX, IMPORT_INVALID_PRIVILEGE, IMPORT_NAME_EXISTS_WITHIN_PARENT, IMPORT_NAME_EXISTS_WITHIN_TYPE, IMPORT_NAME_WITH_UUID_EXISTS_WITHIN_PARENT, IMPORT_UUID_EXISTS_ELSEWHERE, IMPORT_VALID, INFINITY, KM_EXPIRATION_DURATION_CHECK, KM_SECURITY_COMMUNITY, KM_SECURITY_CONTENT_COMMUNITY, KM_SECURITY_CONTENT_FOLDER, KM_SECURITY_CONTENT_KC, KM_SECURITY_FOLDER, KM_SECURITY_KNOWLEDGE_CENTER, KNOWLEDGE_ROOT, KNOWLEDGE_ROOT_SYSTEM_ID, MIGRATION_FLAG, NEGATIVE_INFINITY, NO_CHILDREN, NO_EXPIRATION_TIMESTAMP, NO_FORUM, NO_REVIEW, QUERY_KEYWORDS, RESTRICTION_ROLE_MAP_ROLES, RM_AGGREGATE, RM_EXPLICIT, ROLE_ADMINISTRATORS, ROLE_AUTHORS, ROLE_DENY_ADMINISTRATORS, ROLE_DENY_AUTHORS, ROLE_DENY_READERS, ROLE_MAP_ROLES, ROLE_READERS, RULE_ENCODING, RULES_ROOT_DESCRIPTION, RULES_ROOT_NAME, RULES_ROOT_SYSTEM_ID, SEC_ALL_ADMIN, SEC_ALL_EDITOR, SEC_ALL_VIEWER, SEC_CREATOR_ADMIN, SEC_INH_ADMIN, SEC_INH_ADMIN_MASK, SEC_INH_ALL, SEC_INH_EDITOR, SEC_INH_VIEWER, SEC_PUBLIC, SECURITY_MANAGER_CONFIG, STATE_ACTIVE, STATE_ACTIVE_PENDING_APPROVAL, STATE_ACTIVE_PUBLISHED, STATE_ACTIVE_REJECTED, STATE_PENDING_APPROVAL, STATE_PUBLISHED, STATE_REJECTED, SUBTYPE_CONNECTED_SYSTEM, SUBTYPE_DATA_STORE_CONFIG, SUBTYPE_FOLDER_APPLICATIONS, SUBTYPE_FOLDER_CONNECTED_SYSTEMS, SUBTYPE_FOLDER_DATA_STORE_CONFIGS, SUBTYPE_FOLDER_KNOWLEDGE, SUBTYPE_FOLDER_MIGRATION_FLAGS, SUBTYPE_FOLDER_RULES, SUBTYPE_MIGRATION_FLAG, SUBTYPE_RULE_CONSTANT, SUBTYPE_RULE_DECISION, SUBTYPE_RULE_DECISION_TABLE, SUBTYPE_RULE_FREEFORM, SUBTYPE_RULE_INTERFACE, SUBTYPE_RULE_OUTBOUND_INTEGRATION, SUBTYPE_RULE_QUERY, SYSADMIN_GRP, SYSADMIN_UTYPE, SYSTEM_ASYNC_INSPECT_FOLDER_NAME, SYSTEM_COPILOT_FOLDER_NAME, SYSTEM_FOLDER_COVER_PHOTOS_NAME, SYSTEM_FOLDER_OFFLINE_RULE_BUNDLES_NAME, SYSTEM_FOLDER_RECORD_TYPES_NAME, SYSTEM_FOLDER_TEMPO_ATTACHMENTS_ROOT_DESCRIPTION, SYSTEM_FOLDER_TEMPO_ATTACHMENTS_ROOT_NAME, SYSTEM_IX_FOLDER_NAME, SYSTEM_OBJECT_TEMPLATES_FOLDER_NAME, SYSTEM_OPENAPI_FOLDER_NAME, SYSTEM_PACKAGES_FOLDER_NAME, SYSTEM_RECORD_TYPE_NAME_PREFIX, SYSTEM_SYSRULES_DESIGNER_ROOT_DESCRIPTION, SYSTEM_SYSRULES_DESIGNER_ROOT_NAME, SYSTEM_SYSRULES_INTERNAL_ROOT_DESCRIPTION, SYSTEM_SYSRULES_INTERNAL_ROOT_NAME, TYPE_ALL, TYPE_ANY_KC, TYPE_APPLICATION, TYPE_COMMUNITY, TYPE_COMMUNITY_KC, TYPE_CONTAINER, TYPE_CONTENT, TYPE_CUSTOM, TYPE_DOCUMENT, TYPE_FOLDER, TYPE_IGNORE, TYPE_NON_CONTAINER, TYPE_NON_DOCUMENT, TYPE_PERSONAL_KC, TYPE_RULE, UNIQUE_FOR_ALL, UNIQUE_FOR_PARENT, UNIQUE_FOR_SYSTEM_RULES_LATEST_VERSION, UNIQUE_FOR_TYPE, UNIQUE_FOR_TYPE_AND_SUBTYPE_LATEST_VERSION, UNIQUE_FOR_TYPE_LATEST_VERSION, UNIQUE_NONE, UUID_ACTIVE_PROCESSES_REPORT, UUID_ACTIVE_TASKS_GROUP_MEMBERS_REPORT, UUID_ACTIVE_TASKS_GROUP_REPORT, UUID_ACTIVE_TASKS_REPORT, UUID_ALL_PROCESS_MODELS_REPORT, UUID_ALL_PROCESSES_REPORT, UUID_ALL_TASKS_REPORT, UUID_APPLICATIONS_HOME, UUID_APPLICATIONS_ROOT, UUID_ASYNC_INSPECT_FOLDER, UUID_CANCELED_PROCESSES_REPORT, UUID_COMMUNITY_ROOT, UUID_COMPLETED_PROCESSES_REPORT, UUID_COMPLETED_TASKS_REPORT, UUID_COPILOT_FOLDER, UUID_CURRENT_TASKS_PER_PROCESS_REPORT, UUID_DATA_STORE_CONFIGS_ROOT_FOLDER, UUID_DEFAULT_COMMUNITY, UUID_EMAIL_FOOTER_TEMPLATE, UUID_EMAIL_HEADER_TEMPLATE, UUID_EMAIL_TEMPLATE_FOLDER, UUID_FAVORITE_PROCESS_MODELS_REPORT, UUID_FAVORITE_PROCESSES_REPORT, UUID_FAVORITE_TASKS_REPORT, UUID_HIGH_PRIORITY_TASKS_REPORT, UUID_IX_FOLDER, UUID_LEADER_MESSAGE_PICTURES_FOLDER, UUID_MIGRATION_FLAGS_ROOT_FOLDER, UUID_MOST_ACTIVE_PROCESS_MODELS_REPORT, UUID_NAVIGATION_CONFIG, UUID_NODE_STATS_PER_PROCESS_MODEL_REPORT, UUID_NODE_STATS_PER_PROCESS_REPORT, UUID_OBJECT_TEMPLATES_FOLDER, UUID_OFFLINE_RULE_BUNDLES_FOLDER, UUID_OPENAPI_FOLDER, UUID_OVERDUE_TASKS_REPORT, UUID_PACKAGES_FOLDER, UUID_PAUSED_PROCESSES_REPORT, UUID_PERFORMANCE_INDICATOR_GREEN, UUID_PERFORMANCE_INDICATOR_RED, UUID_PERFORMANCE_INDICATOR_YELLOW, UUID_PRIORITY_ICONS_FOLDER, UUID_PROCESS_DETAILS_PER_PROCESS_MODEL_REPORT, UUID_PROCESS_INSTANCES_PER_MODEL_REPORT, UUID_PROCESS_MODEL_REPORT_FOLDER, UUID_PROCESS_OPTIMIZATION_REPORTS_FOLDER, UUID_PROCESS_REPORTS_FOLDER, UUID_PROCESSES_STARTED_BY_ME_REPORT, UUID_PROCESSES_WITH_PROBLEMS_REPORT, UUID_RULES_ROOT_FOLDER, UUID_RUNNING_PROCESSES_PER_MODEL_REPORT, UUID_STATISTICS_ACROSS_PROCESSES_REPORT, UUID_SUBPROCESSES_PER_PROCESS_REPORT, UUID_SUMMARY_REPORTS_FOLDER, UUID_SYSTEM_DOC_PRIORITY_HIGH, UUID_SYSTEM_DOC_PRIORITY_LOW, UUID_SYSTEM_DOC_PRIORITY_NORMAL, UUID_SYSTEM_FOLDER_TEMPO_ATTACHMENTS, UUID_SYSTEM_KNOWLEDGE_CENTER, UUID_SYSTEM_RECORD_TYPES_FOLDER, UUID_SYSTEM_REPORTS_FOLDER, UUID_SYSTEM_SYSRULES_DESIGNER_ROOT, UUID_SYSTEM_SYSRULES_FOLDER_DESIGNER, UUID_SYSTEM_SYSRULES_FOLDER_ENGINEERING, UUID_SYSTEM_SYSRULES_FOLDER_EVOLVED_PREVIOUS_VERSIONS, UUID_SYSTEM_SYSRULES_FOLDER_HOME, UUID_SYSTEM_SYSRULES_INTERNAL_ROOT, UUID_TASK_REPORTS_FOLDER, UUID_TASKS_DUE_TODAY_REPORT, UUID_TASKS_FOR_USER_REPORT, UUID_TASKS_PER_PROCESS_MODEL_REPORT, UUID_TEMPORARY_DOCS_FOLDER, UUID_TEMPORARY_DOCS_KC, UUID_USER_COVER_PHOTOS_FOLDER, UUID_USER_PICTURES_FOLDER, UUID_USER_THUMBNAILS_FOLDER, UUID_VERSIONS_PER_PROCESS_MODEL_REPORT, VERSION_CURRENT, VERSION_ORIGINAL, VIS_ADVERTISE, VIS_DEFAULT, VIS_HIERARCHY, VIS_INDEXABLE, VIS_QUOTA, VIS_SEARCHABLE, VIS_SYSTEM, VIS_UNLOGGED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionA function that returns aFile
object that represents the document.getBytes()
Gets the number of bytes in the file.Gets the display name, which should be used when the document's name is displayed as one piece (name and extension combined).Gets the extension.com.appiancorp.content.ExtensionMap.ExtensionInfo
Gets the extension info.Gets the filename that will be displayed to the user and that the user will save the file as.Gets the file system ID.Opens a stream to a Document allowing for the caller to read its contents if this Document object was retrieved usingContentService.download(Long, Integer, Boolean)
.Deprecated.since 23.2.Opens a stream to a Document allowing for the caller to write its content if this Document object was retrieved usingContentService.download(Long, Integer, Boolean)
.double
Gets the number of KBytes in the file.Gets whether this document is a symbolic link.void
setExtension
(String extension_) Sets the extension.void
setExtensionInfo
(com.appiancorp.content.ExtensionMap.ExtensionInfo extensionInfo_) Sets the extension info.void
setExternalFilename
(String externalFilename_) Sets the filename that will be displayed to the user and that the user will save the file as.void
setFileSystemId
(Integer fileSystemId_) Sets the file system ID.void
setInternalFilename
(String internalFilename_) Deprecated.since 23.2.void
setSymbolicLink
(Boolean symbolicLink_) Sets whether this document is a symbolic link.void
write
(InputStream inputStream) Write the contents of the inputStream to the Document if this Document object was generated usingContentService.download(Long, Integer, Boolean)
.Methods inherited from class com.appiancorp.suiteapi.content.Content
addSecurity, addSecurity, addVisibility, addVisibility, fillInAppianTypes, getActionRequested, getActionRequester, getAttributes, getChangesRequireApproval, getCreatedTimestamp, getCreator, getCurrentContentId, getDepth, getDescription, getExpirationTimestamp, getFavorite, getForum, getLatestVersionId, getLockedAt, getLockedBy, getLockedByUsername, getLog, getLogName, getNumberOfVersions, getOriginalContentId, getParent, getParentName, getParentType, getPartition, getPartitionName, getPendingApprovalCount, getRoleSet, getSecurity, getSize, getState, getSubtype, getType, getTypesOfChildren, getUpdatedTimestamp, getUsersPendingAccess, getUuid, getVersionId, getVersions, getVisibility, hasChildrenOfType, removeSecurity, removeSecurity, removeVisibility, removeVisibility, securityContains, securityContains, setActionRequested, setActionRequester, setAttributes, setChangesRequireApproval, setCreatedTimestamp, setCreator, setCurrentContentId, setDepth, setDescription, setExpirationTimestamp, setFavorite, setForum, setLatestVersionId, setLockedAt, setLockedBy, setLockedByUsername, setLog, setLogName, setNumberOfVersions, setOriginalContentId, setParent, setParentName, setParentType, setPartition, setPartitionName, setPendingApprovalCount, setRoleSet, setSecurity, setSecurity, setSize, setState, setSubtype, setSubtype, setType, setTypesOfChildren, setUpdatedTimestamp, setUsersPendingAccess, setUuid, setVersionId, setVersions, setVisibility, setVisibility, toString, visibilityContains, visibilityContains
-
Field Details
-
sizeInKB$TRANSIENT
public static final boolean sizeInKB$TRANSIENT- See Also:
-
-
Constructor Details
-
Document
public Document()/** Default constructor (necessary for return converters). AddsContentConstants.SEC_INH_ALL
,ContentConstants.SEC_CREATOR_ADMIN
, andContentConstants.SEC_PUBLIC
to security. Sets the file system ID toContentConstants.ALLOCATE_FSID
. Sets the partition toContentConstants.ALLOCATE_PART
. -
Document
-
-
Method Details
-
getExtension
Gets the extension.- Returns:
- the extension
- See Also:
-
setExtension
Sets the extension. If the document will be saved as a new version, it must have the same extension as the previous version.- Parameters:
extension_
- the extension- See Also:
-
getFileSystemId
Gets the file system ID.- Returns:
- the file system ID
- See Also:
-
setFileSystemId
Sets the file system ID.- Parameters:
fileSystemId_
- the file system ID- See Also:
-
getExternalFilename
Gets the filename that will be displayed to the user and that the user will save the file as.- Returns:
- the external filename
- See Also:
-
setExternalFilename
Sets the filename that will be displayed to the user and that the user will save the file as. This field cannot be updated in the database. It is automatically generated by the database.- Parameters:
externalFilename_
- the external filename- See Also:
-
getInternalFilename
Deprecated.since 23.2. SeegetInputStream()
oraccessAsReadOnlyFile()
to read andgetOutputStream()
orwrite(InputStream)
to writeReturns the full path to the file on the file system if this Document object was retrieved usingContentService.download(Long, Integer, Boolean)
. However, if this Document was retrieved using one of the getContent* methods inContentService
, the internal filename property will be empty and this method will return null.- Returns:
- the full path to the file on the file system
-
setInternalFilename
Deprecated.since 23.2. SeegetInputStream()
oraccessAsReadOnlyFile()
to read andgetOutputStream()
orwrite(InputStream)
to writeSets the location of the file on disk. This field cannot be updated in the database. It is automatically generated by the database.- Parameters:
internalFilename_
- the internal filename
-
getBytes
Gets the number of bytes in the file. This method callsContent.getSize()
.- Returns:
- the size in bytes
-
getSizeInKB
public double getSizeInKB()Gets the number of KBytes in the file. This method callsContent.getSize()
.- Returns:
- the size in KBytes rounded to 2 decimals
-
getDisplayName
Gets the display name, which should be used when the document's name is displayed as one piece (name and extension combined).- Overrides:
getDisplayName
in classContent
- Returns:
- the display name
-
getExtensionInfo
public com.appiancorp.content.ExtensionMap.ExtensionInfo getExtensionInfo()Gets the extension info. This is not automatically populated when you get document from theContentService
. However, you can have the content service populate this field by callingContentService.populateExtensionInfo(Content[])
.- Returns:
- the extension info
- See Also:
-
setExtensionInfo
public void setExtensionInfo(com.appiancorp.content.ExtensionMap.ExtensionInfo extensionInfo_) Sets the extension info.- Parameters:
extensionInfo_
- the extension info- See Also:
-
getSymbolicLink
Gets whether this document is a symbolic link.- Returns:
- whether this is a symbolic link
-
setSymbolicLink
Sets whether this document is a symbolic link.- Parameters:
symbolicLink_
- whether this is a symbolic link
-
getInputStream
Opens a stream to a Document allowing for the caller to read its contents if this Document object was retrieved using
ContentService.download(Long, Integer, Boolean)
.- Returns:
- DocumentInputStream containing the contents of the Document
- Throws:
AppianStorageException
- if an error occurs while opening the input stream for the file- See Also:
-
getOutputStream
Opens a stream to a Document allowing for the caller to write its content if this Document object was retrieved using
ContentService.download(Long, Integer, Boolean)
.This write is NOT appending.
- Returns:
- DocumentOutputStream containing the contents of the Document
see
ContentService.download(Long, Integer, Boolean)
. - Throws:
AppianStorageException
- if an error occurs while opening the output stream for the file- See Also:
-
write
Write the contents of the inputStream to the Document if this Document object was generated using
ContentService.download(Long, Integer, Boolean)
.This write is NOT appending.
- Parameters:
inputStream
- the input stream to copy to the Document- Throws:
AppianStorageException
- if an error occurs while writing the input stream contents to the file- See Also:
-
accessAsReadOnlyFile
A function that returns a
File
object that represents the document. Use ONLY if you need to access the file using a file on disk if this Document was retrieved usingContentService.download(Long, Integer, Boolean)
.Ensures the file is available on disk for the given application server. Updates to file are not supported; please create a new version/Document using
ContentService.uploadDocument(com.appiancorp.suiteapi.knowledge.Document, java.lang.Integer)
, or override existing contents withgetOutputStream()
orwrite(java.io.InputStream)
.- Returns:
- File containing the contents of the Document
- Throws:
AppianStorageException
- if an error occurs while accessing the file- See Also:
-