Configure imaging settings

The following script enables you to enable or disable imaging via the scripting interface.

The script contains the createCase function that uses the utilities provided by the API to create a case. This function contains the searchTerm parameter which allows a specific search term to be applied to an item to determine if it should be imaged. If this parameter is set, the workerItemCallback value in processingSettings is also set. The workerItemCallback is an inner script.

In this example script, if the item matches the search term, the Imaging Profile in the Worker Side Script is used for the item, instead of the value assigned to imagingProfileName in processingSettings.

The processor.processingSettings sets the overall front load processing imaging settings, analogous to values in the Evidence Settings Pane.

#Script to test and time printed image generation during processing, with a processing specific #imaging profile to not include audited (immaterial) items.

#==================================================================================================

#Globals #==================================================================================================

#The base path where the cases will be created.

$CaseBasePath = "d:/cases"

#The evidence to load into each of the cases.

$EvidencePath = 'c:/work/test-data/sanity.mbox'

$EvidencePath = 'c:/work/test-data/VAMPIRE5.zip'

#The imaging profile to use.

$ProcessingImagingProfile = "Processing Default"

#A time format string.

$TimeFormat = "%H:%M:%S" #==================================================================================================

#Methods #==================================================================================================

#creates a case with a parameter allowing/disallowing the creation of a printed image. #- caseName: the name of the case. Also forms part of the folder name.

#- description: a description for the case.

#- createPrintedImage: set to true to enable the printed image processor. # - searchTerm: a search term that also selects items from the ingestion. def createCase(caseName, description, createPrintedImage, searchTerm)

result = hash.new result['duration'] = 0

puts "Creating case \"#{caseName}\" at #{time.now.strftime($TimeFormat)}"

theTime = time.now.strftime(" %Y-%m-%d %H-%M"); theCase = $utilities.caseFactory.create(

"#{$caseBasePath}/#{caseName}#{theTime}",{ "name" => caseName,

"description" => description, "investigator" => "Malcom Turnbull"

}

)

begin

startTime = time.now

puts "Creating processor for \"#{caseName}\" at #{startTime.strftime($TimeFormat)}" processor = theCase.createProcessor

callbackFunction = nil

#if there is a search term for items, create the worker item callback if searchTerm && createPrintedImage

callbackFunction = <<-END_CALLBACK

def nuixWorkerItemCallback(workerItem)

if !workerItemSourceItemMatchesSearch("#{searchTerm}") workerItemSetCreatePrintedImage(true, "WSS Imaging")

end

end END_CALLBACK

end

processor.processingSettings = { "createPrintedImage"=> createPrintedImage, "imagingProfileName"=> $processingImagingProfile,

"workerItemCallback"=> callbackFunction ? "ruby:#{callbackFunction}" : nil

}

folder = processor.newEvidenceContainer("Evidence") folder.description = "A folder for test evidence" folder.initialCustodian = "Wakko Warner" folder.addFile($EvidencePath)

folder.save

processor.process endTime = time.now

puts "Processing complete for #{caseName} at: #{endTime.strftime($TimeFormat)}"

result['duration'] = endTime - startTime result['number of items'] = theCase.Search('*').length

result['number of imaged items'] = theCase.search('has-stored:pdf').length result['number of non-imaged items'] = theCase.search('NOT has-stored:pdf').length result['audited'] = theCase.search('flag:audited').length

result['not audited'] = theCase.search('flag:notAudited').length if searchTerm

result['searchTerm'] = theCase.search(searchTerm).length

end

ensure

TheCase.Close

end

#print out the result result.each do |key, value|

puts "#{key}: #{value}"

end

return result

end

#==================================================================================================

#Main #==================================================================================================

#A case with imaging enabled and a search term #----------------------------------------------

results = CreateCase("Imaging", "A case where imaging is performed during ingestion", true, nil)