PFFile Class |
Namespace: Packflow.Core
public sealed class PFFile : PFBaseObject
The PFFile type exposes the following members.
Name | Description | |
---|---|---|
AltUrl |
Gets an alternative file URL, using the field and file name.
| |
BeforeSaveValues |
Gets the previous values of modified fields before the latest Save.
(Inherited from PFBaseObject.)Note: this feature is NOT persisted in the database and therefore only concerns this instance. | |
CanDelete |
Checks if the current permission context allows current user to delete this object.
(Inherited from PFBaseObject.) | |
CanGetThumbnail |
Returns true if file content is loaded and a thumbnail can be generated for this content.
Image and Word 2010 files are managed.
| |
CanRead |
Checks if the current permission context allows current user to access this object.
(Inherited from PFBaseObject.) | |
CanUpdate |
Checks if the current permission context allows current user to update this object.
(Inherited from PFBaseObject.) | |
Confirmed |
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. | |
Content |
Gets or sets the file's content.
| |
ContentUpdatedAt |
Gets the date of last change of this file's content.
| |
Created |
Indicates if this object has been created and is still in database (positive Id).
(Inherited from PFBaseObject.) | |
CreatedAt |
Gets the date of creation of this object in the database.
(Inherited from PFBaseObject.) | |
CreatedBy |
Gets the user who created this object in the database.
(Inherited from PFBaseObject.) | |
Data |
Gets the data collection of this object.
(Inherited from PFBaseObject.) | |
DateObjectCreation |
Gets the date of the creation of this object in memory.
(Inherited from PFManagedObject.) | |
Deleted |
True if this object is flagged as deleted.
(Inherited from PFBaseObject.) | |
DeletedAt |
Date of the suppression of this object.
(Inherited from PFBaseObject.) | |
DeletedBy |
The user who deleted this object.
(Inherited from PFBaseObject.) | |
EnableVersionMergeToResolveSaveConflicts |
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.) | |
ETag |
Gets the E tag used by WebDAV.
| |
Exists |
Indicates if this object has been created, still exists in database and is not flagged for suppression.
(Inherited from PFBaseObject.) | |
Extension |
Gets the file's name extension.
| |
FieldGuid |
Gets the guid of the field hosting this file.
| |
FieldId |
Gets the id of the field hosting this file.
| |
FieldName |
Gets the name of the field hosting this file.
| |
Guid |
Gets the GUID identifying this object.
Must be used if Id is no more viable, example if content were merged.
(Inherited from PFBaseObject.) | |
HasPendingModifications |
Checks if there is pending changes.
Will check if the values are different from the currently persisted values.
(Inherited from PFBaseObject.) | |
HasPendingPermissionsModifications |
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.) | |
Id |
Gets the id identifying this object.
Must be used to find or identify an object because faster than Guid.
(Inherited from PFBaseObject.) | |
IsFileNameValid |
Gets a value indicating whether this instance is file name valid. Must be non-empty and contain only valid file name characters.
| |
KeepBeforeSaveValues |
Gets or sets a value indicating whether
the Save should keep a collection of the modified fields previous values.
(Inherited from PFBaseObject.)Note: this feature is NOT persisted in the database and therefore only concerns this instance. | |
LockDate |
Gets or sets the lock initial date.
| |
LockDepht |
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.
| |
LockLifetime |
Gets or sets the lock lifetime in seconds.
| |
LockOwnerType |
Gets or sets the lock owner type.
0 = User.
1 = Href: URI Lock owner.
| |
LockQuickPartsSourceInfo |
Gets or sets an information object
used for QuickParts and WordForm version check between file and related parent item
when a lock is active.
| |
LockScope |
Gets or sets the lock scope.
0 = Shared: Shared lock.
1 = Exclusive: Exclusive lock.
| |
LockToken |
Gets or sets the token representing the current lock.
| |
LockType |
Gets or sets the lock type.
0 = Read: Read lock.
1 = Write: Write lock.
| |
LockUserId |
Gets or sets the id of the user owning a lock on this file.
| |
Logger |
Gets the logger, used to log any useful warning, error or information in the database.
(Inherited from PFManagedObject.) | |
LogIdentification |
Gets a technical text representing this object.
(Inherited from PFBaseObject.) | |
Name |
Gets or sets the file's name.
| |
ParentApplication |
Gets the parent application.
| |
ParentContentType |
Gets the parent content-type.
| |
ParentItem |
Gets the parent item.
| |
PermissionContext |
Gets an object calculating permissions on demand.
| |
Permissions |
Gets the permission set (RUD permissions) of this item.
(Inherited from PFBaseObject.) | |
QuickPartsSourceInfo |
Gets or sets an information object
used for QuickParts and WordForm version check between file and related parent item.
| |
Site |
Gets the root of the persisted objects tree.
(Inherited from PFBaseObject.) | |
Size |
Gets the file's size.
| |
UpdatedAt |
Gets the date of the last update of this object.
(Inherited from PFBaseObject.) | |
UpdatedBy |
Gets the user who last updated this object in the database.
(Inherited from PFBaseObject.) | |
Url |
Gets the file relative URL; using the item and file ids.
| |
VersionNumber |
Gets the version number of this object in database. Incremented after each save.
(Inherited from PFBaseObject.) | |
WordFormStatus |
Gets the status of a Word document in a WordForm process.
|
Name | Description | |
---|---|---|
CanGetThumbnailByExtension |
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).
| |
ConvertToPdf |
This method is not implemented in this edition of PACKflow.
| |
Delete |
Flags this object as deleted.
(Inherited from PFBaseObject.)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. | |
GetAltUrl |
Gets the relative URL for the specified file. using the file name as last fragment
| |
GetThumbnail(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.
| |
GetThumbnail(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.
| |
GetUrl(PFFile) |
Gets the relative URL for the specified file.
| |
GetUrl(PFContentType, Int64, Int64) |
Gets the relative URL for the specified file. using the file ID as last fragment
| |
LoadContentFromDatabase |
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.
| |
RunInTransactionArea |
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.) | |
Save |
Applies the data of this object in the database.
(Overrides PFBaseObjectSave.)But also: -Updates ETag. -Updates WordForm status. -Updates ContentUpdatedAt. -Trigger multiple events. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UpdateEtag |
Updates the Etag value from current date time ticks.
|
Name | Description | |
---|---|---|
FieldName_Confirmed |
Column name in database.
| |
FieldName_Content |
Column name in database.
| |
FieldName_ContentUpdatedAt |
Column name in database.
| |
FieldName_ETag |
Column name in database.
| |
FieldName_FieldGuid |
Column name in database.
| |
FieldName_FieldId |
Column name in database.
| |
FieldName_FieldName |
Column name in database.
| |
FieldName_LockDate |
Column name in database.
| |
FieldName_LockLifetime |
Column name in database.
| |
FieldName_LockQuickPartsSourceInfoText |
Column name in database.
| |
FieldName_LockToken |
Column name in database.
| |
FieldName_LockType |
Column name in database.
| |
FieldName_LockUserId |
Column name in database.
| |
FieldName_Name |
Column name in database.
| |
FieldName_QuickPartsSourceInfoText |
Column name in database.
| |
FieldName_Size |
Column name in database.
| |
FieldName_WordFormStatusText |
Column name in database.
|
Name | Description | |
---|---|---|
AsT |
Casts an object to another type. Returns default(T) if the object is null.
(Defined by Utils_Other.) | |
EqualsAll |
Checks that this object is equal to every object in parameters.
(Defined by Utils_Other.) | |
EqualsAny |
Checks that this object is equal to at least one of the parameters.
(Defined by Utils_Other.) | |
GetReference |
Creates a file reference from a PFFile.
Returns null if the passed file is null.
(Defined by PFFileExtensions.) | |
GetString |
Converts an object to String using ToString() method, else returns String.Empty.
(Defined by Utils_Other.) | |
IsGenericList | Overloaded.
Checks if this object is a System.Collections.Generic.List.
(Defined by Utils_Linq.) | |
IsGenericList(Type) | Overloaded.
Checks if this object is a System.Collections.Generic.List using type as T.
(Defined by Utils_Linq.) | |
Serialize | Overloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.) | |
Serialize(String) | Overloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.) | |
SerializeJson | Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.) | |
SerializeJson(ListType) | Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.) | |
SerializeJson(DataContractJsonSerializerSettings) | Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.) |