10 Sample Applications
Each of the sample applications included in this SDK is designed to highlight a specific aspect of the technology's functionality. We ship built versions of these sample applications. The compiled executables should be in the root directory where the product is installed.
The following copyright applies to all sample applications shipped with this product:
Copyright © Oracle 1993, 2014
All rights reserved.
You have a royalty-free right to use, modify, reproduce and distribute the Sample Applications (and/or any modified version) in any way you find useful, provided that you agree that Oracle has no warranty obligations or liability for any Sample Application files.
This chapter includes the following sections:
10.1 Building the Samples on a Windows System
Microsoft Visual Studio project files are provided for building each of the sample applications. For 32-bit versions of Windows, versions of the project files are provided for Visual Studio 6 (.dsp files) and Visual Studio 2005 (.vcproj files).
Note:
Because .vcproj files may not pick up the right compiler on their own, you need to make sure that you are building with the Win64 configuration in Visual Studio 2005. For 64-bit versions of Windows, only the Visual Studio 2005 versions are available.The project files for the sample applications can be found in the \sdk\samplecode\win subdirectory of the Outside In SDK.
10.2 Building the Samples on a UNIX System
See the following sections for specific information about building the sample applications on your flavor of UNIX:
10.3 An Overview of the Sample Applications
This section describes the following sample applications.
Note:
Please note that not all of the sample applications are provided for both the Windows and UNIX platforms. See the heading of each application's subsection for clarification.10.3.1 batch_process_ca
batch_process_ca demonstrates running Content Access in a separate process on multiple input files. It also allows the timing of each run.
The application is executed from the command line and takes several possible parameters:
batch_process_ca -f inputfile -o outputfile or [-d inputdir -o outputdir] [-i iterations] [-q[2]] [-b]
-
-f specifies the name of a single input file.
-
-d specifies the name of an input directory of files.
-
-o specifies the name of an output file if -f is being used, or the name of an output directory if -d is being used.
-
-i is an optional parameter specifying the number of iterations to perform.
-
-q and -q2 diminish the output to the screen.
-
-b increases the amount of content in the output including processing tags and sub-documents.
10.3.2 casample
An example of a typical usage of the Outside In Content Access API is casample. Because this is intended as a simple template or reference for common Content Access usage, it creates only rudimentary output. However, it does initialize, exercise and cleanup Content Access output. Content Access requires the usage of the Outside In Data Access module. Therefore, this application also demonstrates usage of a portion of Data Access.
The application is executed from the command line and takes only one parameter, the name of the input file:
casample input_file
10.3.3 extract_archive
extract_archive demonstrates using the DATree API to extract all nodes in an archive.
The application is executed from the command line and takes two parameters, the name of the input file and the name of an output directory for the extracted files:
extract_archive input_file output_directory
10.3.4 extract_object
extract_object demonstrates using Content Access to parse an input file and then using the DAObject API to extract all embedded objects.
The application is executed from the command line and takes two parameters, the name of the input file and the name of an output directory for the extracted objects:
extract_object input_file output_directory
10.3.5 memoryio
memoryio demonstrates how to use the redirected I/O and Content Access APIs to process an in-memory file.
The application is executed from the command line and takes only one parameter, the name of the input file:
memoryio input_file
10.3.6 parsepst
parsepst demonstrates how to parse email messages from a PST file using the CA API. It searches for messages received between two hard coded dates.
The application is executed from the command line and takes only one parameter, the name of the input file:
parsepst input_file
10.3.7 tademo (Windows Only)
The tademo sample application included with this product provides a simple demonstration of text access. The text from a file is read a block at a time and displayed in the tademo window. The TAReadFirst and TAReadNext functions are directly tied to menu options, and the block size may be set by the user. An option is also provided to save the text to a file.
10.3.8 taredir (UNIX Only)
This sample provides a means of using the API presented in this guide without the need for Motif libraries. All extracted text is output to the standard output device, or can be redirected to a file or another device.
The application is executed from the command line and takes only one parameter, the name of the input file:
taredir input_file
10.3.9 textdemo (UNIX Only)
The sample code in the textdemo files shows how to use the API presented in this guide. This application is essentially identical to the Windows-only application tademo, which is discussed at length in Section 10.3.7, "tademo (Windows Only)."