Click or drag to resize

PFFile Class

Represents an item's file, hosted in a Packflow FileHolder field.
Inheritance Hierarchy

Namespace:  Packflow.Core
Assembly:  MicaSystems.Packflow.Core (in MicaSystems.Packflow.Core.dll) Version: 1.0.0.0 (3.2.0.306)
Syntax
C#
public sealed class PFFile : PFBaseObject

The PFFile type exposes the following members.

Constructors
  NameDescription
Public methodPFFile
Top
Properties
  NameDescription
Public propertyAltUrl
Gets an alternative file URL, using the field and file name.
Public propertyBeforeSaveValues
Gets the previous values of modified fields before the latest Save.

Note: this feature is NOT persisted in the database and therefore only concerns this instance.

(Inherited from PFBaseObject.)
Public propertyCanDelete
Checks if the current permission context allows current user to delete this object.
(Inherited from PFBaseObject.)
Public propertyCanGetThumbnail
Returns true if file content is loaded and a thumbnail can be generated for this content. Image and Word 2010 files are managed.
Public propertyCanRead
Checks if the current permission context allows current user to access this object.
(Inherited from PFBaseObject.)
Public propertyCanUpdate
Checks if the current permission context allows current user to update this object.
(Inherited from PFBaseObject.)
Public propertyConfirmed
Gets a value indicating whether this file has been confirmed after its upload.

A file is confirmed by saving its parent item with a reference to the file in the corresponding FileHolder field value.

Public propertyContent
Gets or sets the file's content.
Public propertyContentUpdatedAt
Gets the date of last change of this file's content.
Public propertyCreated
Indicates if this object has been created and is still in database (positive Id).
(Inherited from PFBaseObject.)
Public propertyCreatedAt
Gets the date of creation of this object in the database.
(Inherited from PFBaseObject.)
Public propertyCreatedBy
Gets the user who created this object in the database.
(Inherited from PFBaseObject.)
Public propertyData
Gets the data collection of this object.
(Inherited from PFBaseObject.)
Public propertyDateObjectCreation
Gets the date of the creation of this object in memory.
(Inherited from PFManagedObject.)
Public propertyDeleted
True if this object is flagged as deleted.
(Inherited from PFBaseObject.)
Public propertyDeletedAt
Date of the suppression of this object.
(Inherited from PFBaseObject.)
Public propertyDeletedBy
The user who deleted this object.
(Inherited from PFBaseObject.)
Public propertyEnableVersionMergeToResolveSaveConflicts
Gets a value indicating whether versions can be merged to resolve save conflicts. If an object is saved with an older version than the last persisted (in database), the system will try to merge the versions values (if no conflicts between values) and will then save the merged item to database. Note : this setting is NOT persisted and will affect this object instance only.
(Inherited from PFBaseObject.)
Public propertyETag
Gets the E tag used by WebDAV.
Public propertyExists
Indicates if this object has been created, still exists in database and is not flagged for suppression.
(Inherited from PFBaseObject.)
Public propertyExtension
Gets the file's name extension.
Public propertyFieldGuid
Gets the guid of the field hosting this file.
Public propertyFieldId
Gets the id of the field hosting this file.
Public propertyFieldName
Gets the name of the field hosting this file.
Public propertyGuid
Gets the GUID identifying this object. Must be used if Id is no more viable, example if content were merged.
(Inherited from PFBaseObject.)
Public propertyHasPendingModifications
Checks if there is pending changes. Will check if the values are different from the currently persisted values.
(Inherited from PFBaseObject.)
Public propertyHasPendingPermissionsModifications
Checks if there is pending modifications in permissions. Will compute permissions (RUD) and check if there is differences with current persisted permissions.
(Inherited from PFBaseObject.)
Public propertyId
Gets the id identifying this object. Must be used to find or identify an object because faster than Guid.
(Inherited from PFBaseObject.)
Public propertyIsFileNameValid
Gets a value indicating whether this instance is file name valid. Must be non-empty and contain only valid file name characters.
Public propertyKeepBeforeSaveValues
Gets or sets a value indicating whether the Save should keep a collection of the modified fields previous values.

Note: this feature is NOT persisted in the database and therefore only concerns this instance.

(Inherited from PFBaseObject.)
Public propertyLockDate
Gets or sets the lock initial date.
Public propertyLockDepht
Gets or sets the lock depth. 0 = ResourceOnly: The method is applied only to the resource. 1 = ResourceChildren: The method is applied to the resource and to its immediate children. 2 = Infinity: The method is applied to the resource and to all of its children.
Public propertyLockLifetime
Gets or sets the lock lifetime in seconds.
Public propertyLockOwnerType
Gets or sets the lock owner type. 0 = User. 1 = Href: URI Lock owner.
Public propertyLockQuickPartsSourceInfo
Gets or sets an information object used for QuickParts and WordForm version check between file and related parent item when a lock is active.
Public propertyLockScope
Gets or sets the lock scope. 0 = Shared: Shared lock. 1 = Exclusive: Exclusive lock.
Public propertyLockToken
Gets or sets the token representing the current lock.
Public propertyLockType
Gets or sets the lock type. 0 = Read: Read lock. 1 = Write: Write lock.
Public propertyLockUserId
Gets or sets the id of the user owning a lock on this file.
Public propertyLogger
Gets the logger, used to log any useful warning, error or information in the database.
(Inherited from PFManagedObject.)
Public propertyLogIdentification
Gets a technical text representing this object.
(Inherited from PFBaseObject.)
Public propertyName
Gets or sets the file's name.
Public propertyParentApplication
Gets the parent application.
Public propertyParentContentType
Gets the parent content-type.
Public propertyParentItem
Gets the parent item.
Public propertyPermissionContext
Gets an object calculating permissions on demand.
Public propertyPermissions
Gets the permission set (RUD permissions) of this item.
(Inherited from PFBaseObject.)
Public propertyQuickPartsSourceInfo
Gets or sets an information object used for QuickParts and WordForm version check between file and related parent item.
Public propertySite
Gets the root of the persisted objects tree.
(Inherited from PFBaseObject.)
Public propertySize
Gets the file's size.
Public propertyUpdatedAt
Gets the date of the last update of this object.
(Inherited from PFBaseObject.)
Public propertyUpdatedBy
Gets the user who last updated this object in the database.
(Inherited from PFBaseObject.)
Public propertyUrl
Gets the file relative URL; using the item and file ids.
Public propertyVersionNumber
Gets the version number of this object in database. Incremented after each save.
(Inherited from PFBaseObject.)
Public propertyWordFormStatus
Gets the status of a Word document in a WordForm process.
Top
Methods
  NameDescription
Public methodStatic memberCanGetThumbnailByExtension
Returns true if the filename's extension indicates Packflow can generate a thumbnail from its content. Returns true for most image files and word 2010 files (when necessary components are available).
Public methodConvertToPdf
This method is not implemented in this edition of PACKflow.
Public methodDelete
Flags this object as deleted.

If it fails, throws an error.

If the object could not be deleted because it does not yet exist in database, returns false.

If successful, returns true.

(Inherited from PFBaseObject.)
Public methodStatic memberGetAltUrl
Gets the relative URL for the specified file. using the file name as last fragment
Public methodGetThumbnail(Size)
Creates a png thumbnail of the file if content is loaded and processable. Image (jpg,tiff,bmp,png), Word 2010 (docx,docm) files are processed. Keeps proportions. Throws NotImplementedException if generation not supported for file. Throws ObjectNotFoundException if file content was not loaded.
Public methodGetThumbnail(Int32, Int32)
Creates a png thumbnail of the file if content is loaded and processable. Image (jpg,tiff,bmp,png), Word 2010 (docx,docm) files are processed. Keeps proportions. Throws NotImplementedException if generation not supported for file. Throws ObjectNotFoundException if file content was not loaded.
Public methodStatic memberGetUrl(PFFile)
Gets the relative URL for the specified file.
Public methodStatic memberGetUrl(PFContentType, Int64, Int64)
Gets the relative URL for the specified file. using the file ID as last fragment
Public methodLoadContentFromDatabase
Loads the current file content from database and initializes the 'Content' value. You may check the content presence by calling this.Data.IsValueAvailable("FieldName_Content"); Useful when working on a shallow copy. Always catch InvalidStateExceptions. May be thrown if the file version in database is higher than the object's version. In this case, reload the PFFile to work on up to date metadata.
Public methodRunInTransactionArea
Runs a code with a transaction on object connection. If there is no current transaction and if the code succeed, transaction is committed. If an exception is thrown, transaction is rollback.
(Inherited from PFBaseObject.)
Public methodSave
Applies the data of this object in the database.

But also:

-Updates ETag.

-Updates WordForm status.

-Updates ContentUpdatedAt.

-Trigger multiple events.

(Overrides PFBaseObjectSave.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdateEtag
Updates the Etag value from current date time ticks.
Top
Fields
  NameDescription
Public fieldStatic memberFieldName_Confirmed
Column name in database.
Public fieldStatic memberFieldName_Content
Column name in database.
Public fieldStatic memberFieldName_ContentUpdatedAt
Column name in database.
Public fieldStatic memberFieldName_ETag
Column name in database.
Public fieldStatic memberFieldName_FieldGuid
Column name in database.
Public fieldStatic memberFieldName_FieldId
Column name in database.
Public fieldStatic memberFieldName_FieldName
Column name in database.
Public fieldStatic memberFieldName_LockDate
Column name in database.
Public fieldStatic memberFieldName_LockLifetime
Column name in database.
Public fieldStatic memberFieldName_LockQuickPartsSourceInfoText
Column name in database.
Public fieldStatic memberFieldName_LockToken
Column name in database.
Public fieldStatic memberFieldName_LockType
Column name in database.
Public fieldStatic memberFieldName_LockUserId
Column name in database.
Public fieldStatic memberFieldName_Name
Column name in database.
Public fieldStatic memberFieldName_QuickPartsSourceInfoText
Column name in database.
Public fieldStatic memberFieldName_Size
Column name in database.
Public fieldStatic memberFieldName_WordFormStatusText
Column name in database.
Top
Extension Methods
  NameDescription
Public Extension MethodAsT
Casts an object to another type. Returns default(T) if the object is null.
(Defined by Utils_Other.)
Public Extension MethodEqualsAll
Checks that this object is equal to every object in parameters.
(Defined by Utils_Other.)
Public Extension MethodEqualsAny
Checks that this object is equal to at least one of the parameters.
(Defined by Utils_Other.)
Public Extension MethodGetReference
Creates a file reference from a PFFile. Returns null if the passed file is null.
(Defined by PFFileExtensions.)
Public Extension MethodGetString
Converts an object to String using ToString() method, else returns String.Empty.
(Defined by Utils_Other.)
Public Extension MethodIsGenericListOverloaded.
Checks if this object is a System.Collections.Generic.List.
(Defined by Utils_Linq.)
Public Extension MethodIsGenericList(Type)Overloaded.
Checks if this object is a System.Collections.Generic.List using type as T.
(Defined by Utils_Linq.)
Public Extension MethodSerializeOverloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerialize(String)Overloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerializeJsonOverloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(ListType)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(DataContractJsonSerializerSettings)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Top
See Also