Skip to content

ImageInfo

ImageInfo is a public class in SAIF.Business that associates a tower record with IFN storage identifiers and exposes helpers for locating and inspecting the underlying image document.

Purpose

  • Stores the tower ID, IFN disk set, IFN ID, and optional image sequence number for an imaged document.
  • Resolves UNC server paths, relative paths, and full file paths for IFN-based image storage.
  • Loads image metadata from the image and imgsys tables through the shared FillBy... factory methods.
  • Determines stored document file types and reads image bytes from disk, optionally under impersonated credentials.

Context

  • Namespace: SAIF.Business
  • Assembly/package: SAIF.Business

Public members

Member Signature Purpose
operator = Public Shared Operator =(x As ImageInfo, y As ImageInfo) As Boolean Returns True when both instances are Nothing or when both instances have the same TowerID.
operator <> Public Shared Operator <>(x As ImageInfo, y As ImageInfo) As Boolean Returns the negated result of the = operator for two ImageInfo instances.
ExistsInDb Public ReadOnly Property ExistsInDb As Boolean Indicates whether the instance was populated from a matching database row.
ExistsOnDisk Public ReadOnly Property ExistsOnDisk As Boolean Checks whether the resolved image file currently exists on disk when IFN values are present.
ImageSeqNum Public ReadOnly Property ImageSeqNum As Decimal Returns the associated image sequence number.
TowerID Public ReadOnly Property TowerID As Decimal Returns the associated tower ID.
IFNDiskSetID Public ReadOnly Property IFNDiskSetID As Decimal Returns the numeric IFN disk-set identifier.
IFNDiskSet Public ReadOnly Property IFNDiskSet As String Converts IFNDiskSetID into the formatted IFN disk-set string used in IFN text values.
IFNID Public ReadOnly Property IFNID As Long Returns the numeric IFN identifier.
IFN Public ReadOnly Property IFN As String Returns the combined IFN: diskset-id text for the current image.
ImageFullPath Public ReadOnly Property ImageFullPath() As String Returns the full UNC path to the image document.
ImageRelativePath Public ReadOnly Property ImageRelativePath() As String Returns the relative IFN folder path for the image document.
ImageServerPath Public ReadOnly Property ImageServerPath() As String Returns the IFN server UNC and disk-set path for the image document.
Environment Public ReadOnly Property Environment As DevelopmentEnvironment Returns the current converted development environment from AppGlobal.EnvironmentService.
GetImageFileType Public Function GetImageFileType(Optional creds As SAIFCredentials = Nothing) As String Determines the current image file type for this instance's IFN values.
GetImageFullPath Public Function GetImageFullPath(Optional includeFileName As Boolean = True) As String Returns the full image path for this instance, optionally omitting the file-name marker.
GetImageRelativePath Public Function GetImageRelativePath(Optional ByVal includeFileName As Boolean = True) As String Returns the relative image path for this instance, optionally omitting the file-name marker.
New Public Sub New(towerID As Decimal, ifnDiskSetID As Decimal, ifnID As Long) Initializes an ImageInfo with tower and IFN values for callers such as PDF services.
New Public Sub New() Initializes an empty ImageInfo.
FillByImageID Public Shared Function FillByImageID(dpi As IDataPortalInfo, imageSeqNum As Decimal) As ImageInfo Loads tower and IFN data for an image sequence number from the image and imgsys tables.
FillByIFN Public Shared Function FillByIFN(dpi As IDataPortalInfo, IFN As String) As ImageInfo Parses an IFN text value and loads the matching image metadata when parsing succeeds.
FillByIFN Public Shared Function FillByIFN(dpi As IDataPortalInfo, IFNDiskSetID As Decimal, IFNID As Long) As ImageInfo Loads the most recent image sequence number and tower data for a specific IFN disk set and IFN ID.
FillByTowerID Public Shared Function FillByTowerID(dpi As IDataPortalInfo, towerID As Decimal) As ImageInfo Loads IFN data and the most recent image sequence number for a tower record.
ToString Public Overrides Function ToString() As String Formats the IFN, tower ID, and optional image sequence number into a display string.
ParseIFN Public Shared Function ParseIFN(ifnText As String, ByRef ifnDiskSet As String, ByRef ifnID As Long) As Boolean Parses IFN: text into separate disk-set and numeric IFN components.
GetImageFullPath Public Shared Function GetImageFullPath(ifnDiskSet As Decimal, ifnID As Long, Optional includeFileName As Boolean = True) As String Builds a full UNC image path from an IFN disk set and IFN ID.
GetImageServerPath Public Shared Function GetImageServerPath(ByVal ifnDiskSetID As Decimal) As String Resolves the UNC server and disk-set root for the supplied IFN disk-set identifier.
GetImageRelativePath Public Shared Function GetImageRelativePath(ByVal ifnID As Long, Optional ByVal includeFileName As Boolean = True) As String Builds the IFN-based relative folder path and optional file-name marker for an IFN ID.
GetImageFileType Public Shared Function GetImageFileType(ByVal inIFNDiskSetID As Decimal, ByVal inIFNID As Long, Optional creds As SAIFCredentials = Nothing) As String Resolves the file path for an IFN pair and then determines the stored document type.
GetImageFileType Public Shared Function GetImageFileType(filePath As String, Optional creds As SAIFCredentials = Nothing) As String Reads file header bytes from disk and maps them to SAIF image file-type codes.
ReadAllBytes Public Shared Function ReadAllBytes(filePath As String, Optional creds As SAIFCredentials = Nothing) As Byte() Reads the entire image file into memory when the file exists.

Behavioral notes

  • ImageFullPath, ImageRelativePath, and ImageServerPath all call a private cache routine that recalculates stored paths only when IFNDiskSetID or IFNID changes.
  • ExistsOnDisk returns False without touching the file system unless both IFNID and IFNDiskSetID are greater than zero.
  • FillByImageID, FillByIFN, and FillByTowerID each return a non-throwing fallback object when no matching row is found.
  • GetImageServerPath special-cases disk-set prefixes beginning with 387-4 to \\idmprod\387-4\; other prefixes are routed to an environment-specific image server.
  • GetImageFileType(filePath, ...) opens the file, reads the first 69 bytes, and maps stored markers to values such as TWR, TXT, JPEG, OLDDOC, OLDXLS, DOC, DOCX, and XLSX.

Constraints and usage notes

  • Use the shared FillBy... methods when the object must be populated from image and imgsys table data; the public constructors do not perform database lookups.
  • ParseIFN expects an IFN pattern shaped like IFN: <diskset>-<id> where the disk-set portion contains digits separated by /.
  • GetImageFileType and ReadAllBytes optionally impersonate through SAIFCredentials before opening files.
  • Equality for two populated instances is based on matching TowerID values rather than matching image sequence numbers or IFN values.

Sources

  • Business\SAIF.Business\ImageInfo.vb