Filebound 7 Api Manual: Application Programming Interface
Filebound 7 Api Manual: Application Programming Interface
This Document is designed to be example driven and does not contain an all-inclusive list of the methods and
functions used in the entire Object Model. The intellisense capabilities of Visual Studio are utilized to show and
explain the usage of the methods available, and it is encouraged to use these in-line descriptions.
FileBound 7 API Manual
Contents
FileBound Object Model Part 1 Overview ............................................................................................4
Main Objects of Interest ...................................................................................................................4
Establishing a Data Connection ...........................................................................................................6
Creating a Business Object..................................................................................................................6
Logging In to FileBound .....................................................................................................................7
Logged In User Account .....................................................................................................................7
Retrieving Projects Collection .............................................................................................................8
Searching for Files............................................................................................................................ 10
Searching for Files Examples ............................................................................................................ 10
Searching for Files – Dynamic Field Number ..................................................................................... 10
Searching for Files – Dynamic Field Number – Shortcut version ......................................................... 11
Creating New Files ........................................................................................................................... 12
Retrieving Documents....................................................................................................................... 13
Creating New Documents.................................................................................................................. 13
Initiate Workflow - Ad-Hoc .............................................................................................................. 15
Initiate Workflow - Defined .............................................................................................................. 16
Manipulating Workflow .................................................................................................................... 17
Adding Projects ................................................................................................................................ 18
Editing Projects ................................................................................................................................ 18
Deleting Projects .............................................................................................................................. 19
Separators and Dividers .................................................................................................................... 19
Adding Groups ................................................................................................................................. 20
Adding Users ................................................................................................................................... 20
Setting Existing Users’ Passwords ..................................................................................................... 21
Adding a User and Setting Group Rights ............................................................................................ 21
Providing Group Rights for a Project ................................................................................................. 22
Revoking Group Rights from a Project............................................................................................... 23
Wiring Collections and Objects ......................................................................................................... 24
Directly Accessing Collections and Objects........................................................................................ 26
Serializing Collections and Objects.................................................................................................... 27
Cloning Objects................................................................................................................................ 28
Tag Properties .................................................................................................................................. 28
Parent Properties .............................................................................................................................. 28
1
FileBound 7 API Manual
Syncing a Collection vs. Saving the Object......................................................................................... 29
Running Reports............................................................................................................................... 31
Managing Reports ............................................................................................................................ 32
E-Forms ........................................................................................................................................... 34
Email ............................................................................................................................................... 36
Printing without a Viewer ................................................................................................................. 37
Getting Image with Annotations ........................................................................................................ 38
TWAIN Scanning ............................................................................................................................. 39
Working with Archives ..................................................................................................................... 40
Annotations...................................................................................................................................... 42
Search.aspx ...................................................................................................................................... 43
Entry.aspx ........................................................................................................................................ 43
FileDetail.aspx ................................................................................................................................. 44
Default.aspx ..................................................................................................................................... 44
Index.aspx........................................................................................................................................ 44
Examples ......................................................................................................................................... 44
Search for Files (Search.aspx): .......................................................................................................... 46
Open Viewer by FileID (viewer.ashx): ............................................................................................... 46
Open Viewer by DocumentID (viewer.ashx): ..................................................................................... 46
Web Viewer (Starting with FileBound 6): ............................................................................................. 47
Entry (entry.aspx): ............................................................................................................................ 47
Renditions (renditions.ashx – Starting with FileBound 6): ....................................................................... 47
Thumbnails (thumbnails.ashx): .......................................................................................................... 47
Barcode (barcode.ashx):.................................................................................................................... 47
Thumbnails.ashx .............................................................................................................................. 48
Viewer.ashx ..................................................................................................................................... 49
Barcode.ashx.................................................................................................................................... 50
Viewer Overview ............................................................................................................................. 51
Combination Viewers – Web connection............................................................................................ 53
Combination Viewers – SQL connection............................................................................................ 54
Document Viewers - Web connection ................................................................................................ 54
Document Viewers – SQL connection................................................................................................ 55
Document Viewers – Document Object.............................................................................................. 55
Command Viewers – Web connection................................................................................................ 56
2
FileBound 7 API Manual
Command Viewers – SQL connection................................................................................................ 56
Command Viewers – FileBound Web connection ............................................................................... 57
Command Viewers – Calling from Web Page..................................................................................... 57
Embedding Viewers in Web pages..................................................................................................... 59
Special Document-Only Viewer - DocView ....................................................................................... 60
Custom Events with the FullViewer................................................................................................... 61
Custom Assemblies with the CommandViewer................................................................................... 62
Custom Viewers for Document Types................................................................................................ 64
Settings Screens for Plug-Ins ............................................................................................................. 68
Web Service Basics Overview ........................................................................................................... 71
Setting Up a Web Reference to DataExchange2.................................................................................. 71
Creating a Web Service Instance of DataExchange2 ........................................................................... 71
Error Handling ................................................................................................................................. 72
Project Examples .............................................................................................................................. 73
File Examples................................................................................................................................... 73
Document Examples ......................................................................................................................... 74
Workflow Examples ......................................................................................................................... 76
Miscellaneous Examples ................................................................................................................... 77
3
FileBound 7 API Manual
The following diagram shows how the Interface layer of FileBound (ASP.NET) uses the Object Model to
communicate via the Business Process Layer, through the Data Access Layer and to the data source (SQL
and document storage).
Developers need to understand this relationship in order to understand the instantiation methodology of
the FBOM. The first thing a developer does is define which data source to use. The second thing is to
define the business object and pass it the data source reference. Once that relationship is established the
object model is primed and ready to use.
4
FileBound 7 API Manual
All objects and collections share common methodologies for retrieving, editing and deleting elements.
This makes the learning curve for developing with the Object Model much shorter.
We strongly encourage all new FileBound developers to study the FileBound Object Model diagram to
familiarize themselves with the object relationships. The above diagram is only a small piece of the entire
puzzle.
5
FileBound 7 API Manual
SQL, Web (Web services connection to FileBound server) and DataArchive come standard with the
FBOM. This enables the developer to communicate with FileBound via a direct SQL connection for faster
speed on a local server, through the FileBound Web server for a remote connection or to a FileBound
Archive. Developers may find it easiest to use the AutoData
method provided in the FileBound.FBFunctions namespace. This will evaluate the incoming connection
string and create the appropriate Data object. For example, if the incoming connection is an HTTP or
HTTPS URL, it will create a Web Data object. If the connection is a SQL ODBC connection string, it
will create a SQL Data object. If the connection is a directory path then it will create a DataArchive
connector.
Custom data objects can be created by inheriting one of the standard objects (if overriding a few methods
is required) or by inheriting the FileBound.Data.Base object and starting from scratch (if creating a
completely new data source). In order to take advantage of custom Data objects the
FileBound.FBFunctions.AutoData() method must be used.
Example – FileBound.Web
Dim FBData As New FileBound.Data.Web("http://serverurl")
Example – FileBound.SQL
Dim FBData As New FileBound.Data.SQL( _
"Persist Security Info=True;User ID=fbuser;password=fbpass" & _
";Initial Catalog=filebound;Data Source=(local)\sqlexpress;")
Example – FileBound.DataArchive
Dim FBData As New FileBound.Data.DataArchive( _
"\\Server\Share\Path\Archive")
Example – FileBound.FBFunctions.AutoData()
Dim FBData As FileBound.Data.BaseData = FileBound.FBFunctions.AutoData("http://serverurl")
Example
6
FileBound 7 API Manual
Logging In to FileBound
In order to send and receive data to and from a FileBound system, the application must authenticate using
a defined FileBound user account. The Login() method on the Business object performs this
authentication. Once authenticated, the rights and abilities provided through the FBOM are limited to the
rights and abilities given to the authenticated user’s account. This means a programmer cannot use a non-
administrator account to perform administrative functions. Any attempt to send/receive data without
being authenticated will result in program errors.
Active Directory is supported with the FBOM if the system is setup to do so. If the FileBound system is
configured properly to use Active Directory then developers can utilize the LoginAD method to log users
in. Based on their user credentials and the FileBound configuration, the user will be brought in without
having to specify a username and password. The user who is logged in to FileBound is the user who is
logged into the computer running the code so keep this in mind.
7
FileBound 7 API Manual
In most cases the objects that fill the collection are filtered by some criteria. For instance, when filling a
Files collection, one would normally filter the resulting collection to only those that matched some search
criteria. For projects, it might be desirable to only return a Project by ID rather than return all projects.
All FBOM collections have Filter objects associated with them. In order to filter the Fill() method by
some criteria, simply set Filter properties accordingly. This is an efficient method of retrieval if only
specific items are required.
Some fairly advanced searching is available using the Filter/Fill() method. All Filters have a MultiIDs
array in them. This provides a way for developers to search for multiple, distinct items in one search by
their corresponding unique IDs. For example, it is quite often useful to search for all projects a user has
access to that are in a list.
8
FileBound 7 API Manual
Another important aspect of collections is being able to tell whether have already been filled. It might be
easy enough to look at the Count property but if it has a Count of 0 does that mean it was not filled or that
it was filled but had no matches? To address this all collections have a Filled property. If the collection
has been filled it will be set to True.
Filling large collections, such as searching for files in a very large project, can be slow to perform. The
FBOM can be instructed to fill only a portion of the search results into the collection. This is done by
setting the RangeBegin and RangeLength properties of the filters. The TotalCount property would then
show how many total files matched the criteria regardless of how many came back into the collection due
to the ranges.
Sorting of collections can also be a slower operation on large collections. Databases are typically more
efficient at sorting so collections also have the ability to be sorted as they are being filled to speed up the
process.
Once a collection is filled it is nice to be able to utilize binding to display the results. Using custom
collections can be tricky at times so a read-only DataSet property has been added to all collections. When
called, a DataSet is returned containing all the data in the collection.
One notable difference to the Files collection is its ability to be extracted into a DataSet as raw data or as
masked data. Fields 1 thru 20 can be altered by the use of field masks so to get the masked values of the
data first set the Files.MaskedDataSet property to True. Then when the DataSet is used it will be
populated with the masked version of the field data.
9
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
'This assumes one project was returned
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field(1) = "1213"
FBProject.Files.Fill()
End If
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
'This assumes one project was returned
FBProject = FBBusiness.Projects(0)
10
FileBound 7 API Manual
Catch ex As Exception
'Failed - assume FieldNum = 1
End Try
'Find files
FBProject.Files.Filter.Field(FieldNum) = "1213"
FBProject.Files.Fill()
End If
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field("Invoice") = "1213"
FBProject.Files.Fill()
End If
One important note about using the field name is that it might trigger one more data fill call to gather the
fields to figure out which field has the given name. For efficiency sake it would be a good idea to avoid
using the Field name if at all possible.
11
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
NOTE: Although the Add methods on the collections accept items of type Object you still must place the
proper objects in the collection. Any attempt at adding an object of the incorrect type to a collection will
result in an exception.
12
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field("Invoice") = "1213"
FBProject.Files.Fill()
'Find documents
FBFile.Documents.Fill()
End If
13
FileBound 7 API Manual
difference is that in order to attach an actual document (TIF file, Word document, etc) the BinaryData
property must be set. This can be done by either the LoadFromDisk() method (to load from a disk file),
SetBITMAP() method (to load an existing bitmap) or by setting the BinaryData property manually with a
byte array. The Save() method saves both the document properties as well as the binary data.
This example extends the File Save example by adding in document uploading.
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
End If
14
FileBound 7 API Manual
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field(1) = "1213"
FBProject.Files.Fill()
'Find documents
FBFile.Documents.Fill()
15
FileBound 7 API Manual
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field(1) = "1213"
FBProject.Files.Fill()
'Find documents
FBFile.Documents.Fill()
16
FileBound 7 API Manual
Manipulating Workflow
Once a document has been routed, it is then possible to manage that document’s progress. When the
document is at a given step it is assigned to one or more users. Referencing the user object’s RoutedItems
collection will show the documents which are currently assigned to that user. Performing Complete() or
Reject() methods on the RoutedItems will move the given items forward or backward in the route in
which the item has been placed while also following the rules that have been configured in the route.
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
With FBBusiness.LoggedInUser
End If
End With
End If
NOTE: Using the ‘ToStep’ parameter of the Complete method will bypass the workflow logic and send the
RoutedItem to that specific step.
17
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Create Project
Dim FBProject As New FileBound.Project("Project ")
FBProject.EnableFullText = True
'etc - add other property settings here
FBBusiness.Projects.Add(FBProject)
FBProject.Save()
End If
Editing Projects
Editing a project is handled the same as editing any object. Reference the Project in question, set
properties and call its Save() method.
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
If FBBusiness.Projects.Count > 0 Then
'If there is a project, turn off "Full Text"
FBBusiness.Projects(0).EnableFullText = False
FBBusiness.Projects(0).Save()
End If
End If
18
FileBound 7 API Manual
Deleting Projects
Deleting a project is handled similar to deleting any object. Reference the Project in question and call its
Delete() method. CAUTION: This action will permanently delete the Project and all dependent
information.
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
If FBBusiness.Projects.Count > 0 Then
'If there is a project then delete it
FBBusiness.Projects(0).Delete()
End If
End If
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
19
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Create Group
Dim FBGroup As New FileBound.Group("New Group Name")
FBGroup.FileSearch = True
FBBusiness.Groups.Add(FBGroup)
FBGroup.Save()
End If
Adding Users
Like other objects and collections, adding users is really a matter of adding new objects and saving them.
The following example adds a new user “John Doe” to the system.
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Add a user
Dim FBuser As New FileBound.User("jdoe")
FBuser.DisplayName = "John Doe"
FBBusiness.Users.Add(FBuser)
End If
20
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Add a user
Dim FBuser As New FileBound.User("jdoe")
FBuser.DisplayName = "John Doe"
FBBusiness.Users.Add(FBuser)
Catch
'Did not find the group
21
FileBound 7 API Manual
End Try
End If
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Get project collection
FBBusiness.Projects.Fill()
'Find Project
Dim FBProject As FileBound.Project = _
FBBusiness.Projects.FindProject("ABC")
'Get Groups
FBBusiness.Groups.Fill()
'Find Group
Dim FBGroup As FileBound.Group = _
FBBusiness.Groups.FindGroup("GRPNAME")
22
FileBound 7 API Manual
'Log in
FBBusiness.Login("admin", "admin")
If Not FBBusiness.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Else
'Get Groups
FBBusiness.Groups.Fill()
'Find Group
Dim FBGroup As FileBound.Group = _
FBBusiness.Groups.FindGroup("ThisGroup")
23
FileBound 7 API Manual
In order for an object to be saved it must be placed into context. An object created in memory is not
attached to anything of value data-wise. Once that object is placed into a collection it is then associated
with that collection which in turn must be associated with another object/collection and so on up to the
top level objects that are attached to the Business object which is attached to the Data object. By the way
the items are instantiated and connected a bridge is built from every object to the data source. This is
called “wiring” up the object or collection.
Wiring consists of using event delegates in the objects to cause an object’s Save, Delete, etc methods to
be sent up the chain of objects until the Business object can operate on it and send it to the Data source.
The very act of placing an object into a collection causes an internal wiring event to happen so it is all
transparent when done that way. However, it is possible to save a document without placing it into a
File’s Documents collection. The Business object has a WireObject method that can wire the object into
the event chain directly and the object can then be saved or deleted.
The practical use of this is sometimes hard to see but if a solution is being developed where the ID of the
File that a document belongs to is already known then having to get a project object, fill the files
collection with one file and then add a document to its Documents collection can all be avoided.
Here is an example of the above scenario done 2 ways. First is the standard ‘collection’ way:
'Retrieve project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
Dim FBP As FileBound.Project = FBBusiness.Projects(0)
24
FileBound 7 API Manual
Now here is the same example done the direct wiring way:
The direct wiring example is much simpler and is also much more efficient as it avoids 2 extra collection
fills (Projects and Files). However, the IDs of the items in question must already be known to use this
method with any level of success.
25
FileBound 7 API Manual
In the example in the previous section a Document was saved into a known File. To retrieve that
document in the standard way all collections from Projects down to Documents would need to be filled.
However, if the ID for the Document was retained, that document could be retrieved directly. Here is the
code to do this (assuming an ID of 500 for the Document):
Dim D As FileBound.Document
D = FBBusiness.GetObjectItem
(FBEnumerations.ObjectType.Document, 500)
Collections operate slightly differently in that the collection’s filter properties must be set then send it in
to be filled by the Business object. The following example shows how to get the Document collection
from a File with an ID of 120:
26
FileBound 7 API Manual
The FBOM supports serialization and de-serialization of its objects and collections inherently. All
collections and objects have a Serialize method that can either write the contents to a file or return a byte
array of the serialized data. To de-serialize the data back into an object or a collection, use the Business
object’s Deserialize method. The following example demonstrates this.
With FBBusiness.Projects
'Get project list
.Fill()
'Save to temp file
.Serialize("c:\test.xml")
'Clear out project list in memory
.Clear()
'Bring back the serialized collection
FBBusiness.Projects = _
FBFunctions.Deserialize("c:\test.xml", .GetType)
'Prove the collection was restored
Debug.Print(.Count)
End With
Serialization is a very important part of the FBOM and is what allows the FileBound data to be
transported easily across the Internet and through multiple tiers.
27
FileBound 7 API Manual
Cloning Objects
Most FBOM objects support a Clone() method. This allows developers to make exact copies of objects in
memory. This is important since just making a new object variable and assigning it to an existing object
merely makes a new reference to the same object in memory. Cloning the object actually make a new
object in memory – not just a pointer. This is useful if the need is to actually duplicate a document in a
file for example. Without cloning the developer would need to manually create a new document to do it
properly.
Tag Properties
All Collections and Objects in the FBOM have a Tag property. This is of type Object and can be used for
temporary storage of any type of information a developer chooses. It is meant to allow other data to flow
along with the objects during normal processing. The data in the Tag property is never directly saved by
FileBound so it cannot be used as long term storage unless the developer also makes considerations for
that as well.
On important note about the Tag property is that any data stored in it MUST be serializable if it is
intended to be sent through a Data connector since the Data connectors serialize the objects to work with
them. Placing non-serializable objects in the Tag property will cause data operations to fail.
Parent Properties
All Collections and Objects in the FBOM have a Parent property. This property allows the developer to
manually navigate to the next higher level in the object and collection chains. Since some collections can
be contained inside of more than one object type (for instance, Documents are in both the File.Documents
collection and the Archive.Documents collection) the Parent property is handy to determine in what
object the object or collection is contained. The following example demonstrates this:
28
FileBound 7 API Manual
To add the User to the Group the developer would add the User object to the Group’s Users collection
and then call the Group.Users.Sync method. This Sync process updates the many-to-many relationship
pointers without actually altering the objects themselves.
Calling Sync on a standard collection (one with a one-to-many relationship) will trigger the collection to
iterate through its items and call each item’s Save method directly so this can be used as a shortcut to
mass update saves.
Another component of Syncing is the concept of the Object.SyncFlag property. The SyncFlag property is
set automatically on each object as it is added to or removed from a collection. In the example of the
Group.Users collection above each time a User is added to the Users collection its SyncFlag is set to
Added. The Sync method then simply iterates through the objects and any object where the SyncFlag is
not set to NoChange requires a status update in the database. An example might help clarify some of the
finer points.
It would be quite easy to add a new user and place them in the group as follows:
'Add user
Dim User As New FileBound.User
User.Name = "Test User"
FBBusiness.Users.Add(User)
User.Save()
29
FileBound 7 API Manual
The example above works fine and the user is now in 2 groups. However, to remove this user from one
of these groups is much trickier. Consider the following example:
If the item is simply removed from the collection then how does the data source know to remove the item
that is no longer there? When the data source receives the collection only one item will be visible. The
first thought is to have the collection be all-inclusive so that when Sync is called then only that which is
left in the collection is then reflected in the database and any missing items will be removed. This,
however, becomes very inefficient since the FBOM would need to serialize and send over the wire every
object in every collection just to remove from or add to the collection a single item.
To overcome this shortcoming and keep efficiency at the forefront, the Sync method looks at the
SyncFlag properties of the objects. This way the FBOM can operate only on those items that need
attention. To remove an item from this type of collection simply set that item’s SyncFlag property to
Delete then call the Sync() method. The example above should be done like this:
30
FileBound 7 API Manual
There are 2 object types to learn about when dealing with reports –Reports and ReportParms. The Report
object represents the report entity itself. Retrieving a list of reports from the Business object will show
what reports are available to the logged in user. The report object can then have its ReportParms
collection filled to see what parameters of what type are available for querying this report. Here is an
example of querying, finding and running a report:
End If
31
FileBound 7 API Manual
The ReportParms collection is perfect for dynamically creating a report search form. Here is a small
excerpt of code for adding fields to a FlowLayoutPanel.
** Notice setting the Tag property of the MaskedTextBox to the name of the ReportParam so that name and the box’s value can be
used in the Report run sequence later.
R = CType(listbox1.SelectedItem, FileBound.Report)
R.ReportParms.Fill()
Next
Managing Reports
Not only can reports be run programmatically, they can also be added and removed programmatically as
well. Of course the SQL logic will need to be created for the report based on its particular needs. Once
that is done the rest is easy.
'Add report - needs to have the name of the SP as the 2nd parameter!
FBR = New FileBound.Report("Custom Report", _
"FBReport_Custom", _
CommandType.StoredProcedure, _
FBEnumerations.ReportLevel.LevelGlobal)
FBBusiness.Reports.Add(FBR)
FBR.Save()
32
FileBound 7 API Manual
FBRP.Save()
End If
Deleting a report is handled in the same way as deleting any object in the FileBound Object Model. Call
that object’s Delete() method.
33
FileBound 7 API Manual
'Log in
FBB.Login("admin", "admin")
If Not FBB.LoggedIn() Then
MessageBox.Show("Unable to log in", "Login Failed")
Return
End If
Try
'Attach document to file's Documents collection
F.Documents.Add(D)
34
FileBound 7 API Manual
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
35
FileBound 7 API Manual
Email
Email through the FBOM can be either client-side (MAPI) or server-side (SMTP). Which one to use
when is a matter of discretion but essentially any time the end user needs to see the email before it is sent
(to address it, add comments, etc) use MAPI, else use SMTP.
.Send()
End If
End With
.To([To])
.From = [From]
.Subject = m_Document.DocumentID.ToString & _
" - " & "Document." & m_Document.Extension
.Body = "Information" & vbCrLf & _
m_Document.DocumentID.ToString
.Attach(TempFileName)
.Send()
End If
End With
36
FileBound 7 API Manual
'Get document
Dim m_Document As FileBound.Document = _
FBBusiness.GetObjectItem(FBEnumerations.ObjectType.Document, 123)
37
FileBound 7 API Manual
'Get document
Dim m_Document As Document =
FBBusiness.GetObjectItem(ObjectType.Document, 35421)
m_Document.PopulateDocument()
38
FileBound 7 API Manual
TWAIN Scanning
As anyone in the imaging business knows, scanning is a major part of any document-oriented system.
The FBOM has its own TWAIN interface so it can actually be used to scan in TWAIN with no other 3rd
party controls or assemblies.
Try
FBTwain.ScanPages(1) 'Show dialog (1)
Catch ex As Exception
MessageBox.Show("Error scanning.", "Scanning", _
OK, Exclamation)
End Try
End Sub
End Sub
39
FileBound 7 API Manual
• Building – Building an Archive is the process of arranging Documents into the respective Archive
object’s Documents collection. Building Archives can be accomplished programmatically by making
an Archive object then adding Documents to its Documents collection and Syncing the collection.
• Managing – Managing an Archive is the process of taking the archive offline or removing it
completely from the system. Managing an Archive can be accomplished programmatically by
actually setting the Status of each of its Documents to Archived and saving (to take offline) or by
calling each Document’s Delete method (to Delete the archive).
• Creating – Creating an Archive is the process of arranging the contents of the Archive in a
searchable format. Creating the archive can be accomplished programmatically by calling the
Archive’s Create() method with a path to the folder in which to place the searchable content. There
are events named CreateStatus and CreateProgress to monitor the status text and the percent complete
of the creation process.
• Burning – Burning an Archive is the process of placing the Archive on CD or DVD media. Burning
requires CD or DVD authoring software or can be accomplished by using FileBound tools such as the
Integration Kit.
The following is an example of how to programmatically create and Archive using the Archive’s Create()
method.
End Sub
40
FileBound 7 API Manual
41
FileBound 7 API Manual
Annotations
Annotations are a very important and powerful component of FileBound. Starting with Version 5 the
Annotation system is data-driven and can be controlled by simply adding and manipulating objects just
like any other FBOM object.
Annotations are accessed normally through the Document object’s Annotations collection. Annotation
items can be added to and removed from the collection. For instance, adding a rectangle annotation to an
image requires only adding and saving an Annotation object of type “Rectangle” to the Annotations
collection and when the document is viewed in FileBound the annotation will show up.
'Get project
Dim Project As FileBound.Project = _
FBBusiness.Projects.FindProject(21)
Project.Files.Fill()
'Get file
Dim File As FileBound.File = _
Project.Files.FindFile(68942)
File.Documents.Fill()
'Get document
Dim Document As FileBound.Document = File.Documents(0)
Document.PopulateDocument()
It is important to note that not all Annotation types support all properties and methods of the Annotation
object. The following exceptions should be noted.
42
FileBound 7 API Manual
Search.aspx
The search page will use values found in the Query String to pre-fill the search values and perform the
search.
Entry.aspx
The Entry page will use values found in the Query String to pre-fill the index fields for the file.
43
FileBound 7 API Manual
FileDetail.aspx
Parameter Name Usage
FileID The ID of the File to load.
ShowViewer “1” – Launches the viewer immediately after the load of the page.
Default.aspx
The FileBound login page will use values found in the Query String to set State properties, auto-log in the
user, and redirect to a return URL.
Index.aspx
The Indexing Queue page or Indexing Web Viewer will use values found in the Query String to prefill
Documents.
Examples
Directly load a File in the Viewer
http://mysite.filebound.com/Output/Viewer.ashx?ProjectID=25&FileID=1720&ShowViewer=1&FBG
UID=961f74e1-2a27-4add-9e12-496ff2edf5cc
44
FileBound 7 API Manual
Directly perform a search on project with ID 25 where Field3 is between 60000 and 90000
http://mysite.filebound.com/Search.aspx?ProjectID=25&Direct=1&FBguid=961f74e1-2a27-4add-
9e12-496ff2edf5cc&Field3=60000&Field3To=90000
Pre-load Entry page on Project with ID 25, set Field1=Some Value, Field3=60000
http://mysite.filebound.com/Entry.aspx?ProjectID=25&Direct=1&FBguid=961f74e1-2a27-4add-9e12-
496ff2edf5cc&&Field1=Some%20Value&Field3=60000
45
FileBound 7 API Manual
You can pass the FBGUID parameter for authentication if you already have one from your
integration
http://localhost/FB7/search.aspx?ProjectID=2&Field1=205672&Direct=1&FBguid=961f74e1-2a27-4add-9e12-
496ff2edf5cc
You can also pass credentials in the URL (only recommended if passing "view only" credentials)
http://localhost/FB7/search.aspx?
ProjectID=2&Field1=205672&Direct=1&username=viewonly&password=vie wonly1
Note: If cookies are enabled or if Active Directory is enabled for the site, authentication should happen
without passing any parameters in the URL string.
http://localhost/FB7/output/viewer.ashx?DocumentID=5
Open the full viewer but go to a specific DocumentID (loads all pages and file index information but
goes to the specific document in the full viewer)
http://localhost/FB7/output/viewer.ashx?DocumentID=5&ShowFileViewer=1
46
FileBound 7 API Manual
http://localhost/FB7/WebViewer/WebView?
http://localhost/FB7/WebViewer/WebView?DocumentID=5
Entry (entry.aspx):
Load the entry page for a Project:
http://localhost/FB7/entry.aspx?ProjectID=2&Field1=123456&Field2=555&Field3=Test
DocumentID
Thumbnails (thumbnails.ashx):
http://localhost/FB7/output/thumbnails.ashx?
DocumentID=5&height=225
Barcode (barcode.ashx):
http://localhost/FB7/output/barcode.ashx?text=00F00&height=30
A handler typically used in integrations to embed a barcode image. VB.NET Example:
BarCode.ImageUrl = State.RootPath + “Output/Barcode.ashx?Text=” + Server.UrlEncode(Document.Div ider)
47
FileBound 7 API Manual
Thumbnails.ashx
Handler: Thumbnails.ashx
NOTE:
Scale takes preference over height and width. If Scale, Width, and Height are all undefined a Default
Height of 225px is used.
Example:
imgClicker.ImageUrl =String.Format(State.RootPath + Output/Thumbnails.ashx?DocumentID={0}",
50)
48
FileBound 7 API Manual
Viewer.ashx
Handler: Viewer.ashx
Description: The Viewer handler is used to load the FileBound viewer from a click on the
website. The handler uses the query string parameters to determine how to
preload the FileBound Command Viewer. The Command Viewer is streamed to
the browser and the FileBound Viewer is loaded.
Examples:
Javascript
window.location.href = RootPath + 'Output/Viewer.ashx?FileID=' + FileID + '&FileIDs=' + FileStr;
Document Viewer
e.Row.Attributes.Add("onclick", "javascript:document.location.href='" + State.RootPath +
Output/Viewer.ashx?DocumentID=" + dr("DocumentID").ToString() + "'")
File Viewer
FileViewer.NavigateUrl = State.RootPath + "Output/Viewer.ashx?FileID=" + Archive ID to pass to
Viewer (used in Archive Viewer). FBFile.FileID.ToString()
Admin Viewer
Response.Redirect(State.RootPath + "Output/Viewer.ashx?ShowAdmin=true")
Scan Viewer
ScanDocuments.NavigateUrl = State.RootPath + "Output/Viewer.ashx?FileID=" +
FBFile.FileID.ToString() + &ShowScan=1&Divider=DividerName"
49
FileBound 7 API Manual
Barcode.ashx
Handler: Barcode.ashx
Description: The Barcode handler is used to return a Code 39 barcode image for the Text
value passed in.
Parameter Name Usage
Text (required) – value passed here will be returned as a Code 39 barcode image.
Example:
BarCode.ImageUrl = State.RootPath + "Output/Barcode.ashx?Text=" +
Server.UrlEncode(Document.Divider)
50
FileBound 7 API Manual
Viewer Overview
There are 3 basic viewer types available – file viewers, document viewers and combination viewers. File
viewers handle viewing and navigating the page list of the file. This would typically be the tree view
portion of the viewer. Document viewers handle viewing the actual documents. Combination viewers
wrap the file and document viewers into a single control for easier integration.
The Full Viewer (combination viewer) is shown below. This component is referenced via
FileBound.Viewers.FullViewer. It houses both the File Viewer and Document Viewer so it would
normally be the viewer of choice to give full functionality to custom applications.
The File viewer is highlighted below. This component is available by itself and is referenced via
FileBound.Viewers.FileViewer.
51
FileBound 7 API Manual
The Document viewer is highlighted below. This component is available by itself and is referenced via
FileBound.Viewers.DocumentViewer.
52
FileBound 7 API Manual
53
FileBound 7 API Manual
54
FileBound 7 API Manual
55
FileBound 7 API Manual
56
FileBound 7 API Manual
The new viewer system that is used by FileBound is far superior to our old viewer in many ways but no
way is more evident than in the way the viewer is instantiated. In previous versions the viewer was
embedded as an ActiveX control and provided a fairly seamless interface between the Web pages and the
viewer. However, security concerns and ActiveX in general were a constant nuisance and an upgrade
nightmare. Not to mention they were only supported in Internet Explorer.
FileBound Version 5’s viewer actually uses built in file download capabilities of the browsers (IE,
FireFox and others) to download a command file that is created by a server-side version of the Command
Viewer. That command file is sent down as an FBV (FileBound Viewer) file type which is associated
with our viewer launcher app that is installed on the local client during the viewer install process (which
can be automated through AD or SMS). Once that file is downloaded it is sent to the
FBViewerLauncher.exe application where it is re-instantiated into a client-side version of the Command
Viewer and launched locally. In this way the viewer commands are controlled by the command viewer
object and the viewer can be completely disassociated from the browser itself so the viewers are no longer
limited by browser type!
To take advantage of this system from web pages simply instantiate a server-side Command Viewer
object, set the properties desired and call the CommandViewer.CreateCommands method to get the
encrypted binary data that needs to be sent back through to the browser. Before the data is sent back to
the browser, the ContentType and Disposition header must be set appropriately as shown in the following
example which was written in ASP.NET.
57
FileBound 7 API Manual
CV.SiteURL = "http://localhost"
CV.SessionID = Session.SessionID
CV.ProjectID = 322
CV.FileID = 5786
CV.ViewerType = Interfaces.Viewers.ViewerType.File
context.Response.ContentType = FileBound.FBFunctions.GetContentType("fbv")
context.Response.AddHeader("content-disposition", _
"inline; filename=Viewer.fbv")
context.Response.BinaryWrite(CV.CreateCommands())
It is important to note that the CreateCommands packet is fully encrypted so it hides connection
information. The exception is at the top of the packet will be a Server URL and a Version. This is used
by the FBViewerLauncher application to determine whether or not it has the correct FileBound.dll loaded
locally. If not then it automatically downloads the correct version and instantiates it dynamically to
ensure proper viewer versions per server.
58
FileBound 7 API Manual
<head>
<script type="text/javascript">
<!--
function ViewDoc()
{
document.getElementById('DocumentViewer').SiteURL='http://localhost';
document.getElementById('DocumentViewer').SessionID='asdfaasd';
document.getElementById('DocumentViewer').ProjectID=2;
document.getElementById('DocumentViewer').FileID=2644;
document.getElementById('DocumentViewer').DocumentID=115604;
document.getElementById('DocumentViewer').ShowData();
}
// -->
</script>
</head>
</body>
</html>
** Please note that embedding the viewer in a Web page in this manner is very tricky due
to security constraints and is not a supported method. This is only documented for
completeness and for those who have requested to see how it could be done.
59
FileBound 7 API Manual
'Find project
Dim FBProject As FileBound.Project
FBBusiness.Projects.Filter.ProjectID = 2
FBBusiness.Projects.Fill()
FBProject = FBBusiness.Projects(0)
'Find files
FBProject.Files.Filter.Field(("Invoice Number") = "1213"
FBProject.Files.Fill()
'Find documents
FBFile.Documents.Fill()
60
FileBound 7 API Manual
The events that can be hooked into include, but are not limited to, the following list:
• Document loading
• Menu creation
• Toolbar creation
• Document printing
• Plug-In execution
• Annotation Burn-in
• Getting archive path
• Etc (refer to the intellisense of the FullViewer object for the full list of events)
To get started, create a class that implements the iViewerPlugin interface and have a place to store the
FullViewer reference for later use. In this example we will add a page-level menu option to rotate the
page.
End Class
Next, make sure to implement the Init method making sure to capture the FullViewer reference. Also
notice that here is where we would add some event handlers.
m_FullViewer = FullViewer
61
FileBound 7 API Manual
End Function
For the event handler (in this case a menu update) add in the necessary method to handle the call.
Private Sub SetMenus( _
ByVal RootMenu As Windows.Forms.ContextMenuStrip, _
ByVal FileMenu As Windows.Forms.ContextMenuStrip, _
ByVal SeparatorMenu As Windows.Forms.ContextMenuStrip, _
ByVal DividerMenu As Windows.Forms.ContextMenuStrip, _
ByVal PageMenu As Windows.Forms.ContextMenuStrip, _
ByVal MasterSheetMenu As Windows.Forms.ContextMenuStrip)
Next, we need to add in a method called TestMenuClick to handle the actual click of the menu.
m_FullViewer.DocumentViewer.RotateRight()
End Sub
Lastly we need to add in the loading of this class and call the Init() function. This is done directly after
calling ShowData().
Now any time the custom menu item is clicked the currently-displayed page will rotate right. Notice
there are options to add menu items to any level of menu in the treeview. The FB_Set_Toolbar event is
raised that allows you to add toolbar buttons in the document viewer screen as well. A good look through
the viewer events will give a good feel of what options are available.
62
FileBound 7 API Manual
CustomAssemblies. This holds a list of assemblies to add into the viewer when it is instantiated. On the
server side simply add into the list the full paths of all the assemblies needing to be loaded. The path can
either be a standard driver letter path or an Internet path (URL). The command viewer simply loads the
assembly and calls its Init method. For this reason the assembly MUST implement the iViewerPlugin
interface.
NOTE: The list of assemblies is added server-side but is executed client-side so make sure the paths are
valid from the client.
From a Web server interface, serve the CreateCommands result to the client browser.
context.Response.ContentType = _
FileBound.FBFunctions.GetContentType("fbv")
context.Response.AddHeader("content-disposition", _
"inline; filename=Viewer.fbv")
context.Response.BinaryWrite(CV.CreateCommands())
Another option for adding this functionality is to rely on the CommandViewer to do it. CommandViewer
will look in the folder of the EXE that calls it for a folder name ‘Plugins’. If it finds one it will attempt to
load all assemblies in that folder as if they were fed through the CustomAssemblies array. Since this
happens at the client level this can greatly simplify installation and can make rolling out of features much
easier. The standard place for the viewer to look for PlugIns in this fashion is the ‘Program
Files\FileBound\Viewer\Plugins’ folder of the client but may change if FBViewerLauncher.exe is moved.
One more option is to utilize the Plug-Ins system to distribute the assemblies for you. When the
CommandViewer loads during normal operation in the FileBound Web interface any Plug-ins that are set
to the “In Viewer” mode will automatically be loaded into the viewer. To do this set the following
properties in the Plug-In setup screen – Hidden, In Viewer with a File Path of the URL to the DLL
(relative or absolute URL).
63
FileBound 7 API Manual
The heart of this method is creating a UserControl to allow for the viewing and possibly editing of the
document type. Then implementing the iDocViewPlugin interface provides the rest of the methods
required for this to work.
The following example demonstrates how to use this interface to create a custom viewer control to allow
editing of text (TXT) files. This requires a UserControl with a text box named TextBox1.
64
FileBound 7 API Manual
End Sub
End Sub
End Sub
End Sub
End Function
End Sub
65
FileBound 7 API Manual
End Function
End Sub
End Sub
End Class
To use the Plug-Ins from your own application you will need to respond to the viewer’s requests for
assemblies by handling the DocumentViewer.FB_LoadCustomAssembly event. Here is a small example
of how to handle this event.
66
FileBound 7 API Manual
FV.Parent = Me
FV.Visible = True
FV.Dock = DockStyle.Fill
FV.Connection = ConnectionString
FV.UserName = Username
FV.Password = Password
FV.ProjectID = 1
FV.FileID = 100
FV.ShowFileViewer = True
FV.ShowData()
End Sub
DocViewPlugin = Nothing
For Each TestPlugin _
As FileBound.Interfaces.Viewers.iDocViewPlugin _
In DocViewPlugIns
If TestPlugin.FileTypes.Contains(FileType.ToUpper) Then
Dim t As Type = TestPlugin.GetType
DocViewPlugin = Activator.CreateInstance(t)
Return
End If
Next
End Sub
End Class
** Important note: if you need to write documents out to a temp location for processing you can use the
TempFolder property that is defined in the interface. This will be set to the unique temp folder location
for the instance of the DocView control that loads the control. Since multiple viewers could be loaded at
once and each could have multiple DocView controls showing at the same time it is best to leave the temp
folder work to the viewer system.
67
FileBound 7 API Manual
Coding a User Control to this interface will allow developers to display their settings within the standard
viewer settings screen. The interface is quite simple and allows for retrieving, saving and verifying
settings as well as categorizing and naming the setting screen and setting a 16x16 pixel image for display
purposes. In the screen shot below ‘Category’ is the bold heading (ie File Settings, Document Settings
and My Application). ‘Name’ is the non-bolded items under the categories.
This interface only provides you with a structure to manage your settings. Storing and retrieving the
settings needs to be done by you. It is typical to store them in the Windows Registry as in the example
below or to add them to the LoggedInUser.ExtendedProperties collection. However, you can use
whatever method you choose. Typically User Controls for settings are included in the same assembly as
the custom code that uses them and are distributed in the same way as Viewer Plug-Ins.
A simple implementation like the one above can be accomplished by creating a User Control and setting
it to implement the FileBound.Interfaces.Viewers.iViewerSettings interface.
Once that interface is implemented you will need to fill in the structure of methods that are created for
you automatically in Visual Studio. One thing to note is that the SecurityBypass method allows for the
development of security-allowed settings screens. If the SecurityBypass method returns TRUE then this
Pllug-In will not load – therefore bypassing the Plug-In based on security checks. Here is the full code
for the above example and it assumes this code is in a User Control with 2 text boxes on it called
txtLocation and txtPassword.
68
FileBound 7 API Manual
Imports Microsoft.Win32.Registry
Public Class ctlSettingsTest
Implements FileBound.Interfaces.Viewers.iViewerSettings
End Sub
69
FileBound 7 API Manual
Catch ex As Exception
Return False
End Try
Return True
End Function
Return True
End Function
End Class
70
FileBound 7 API Manual
71
FileBound 7 API Manual
Error Handling
DataExchange2 is comprised of routines that perform a variety of remote operations on a data
source/destination. Some of these routines return a data value, and the returned value can be one of a
number of types (for example, one routine might return the long integer type, but another might return a
string type). To accommodate for this inconsistency, and to keep error handling relatively simple, a
number of special error-handling routines are included with
DataExchange2.
When an error occurs in DataExchange2, it is handled in one of three ways. The handling procedures are
as follows:
a. The error is returned in XML form. This is the case for routines that return a string.
b. The error is recorded, and a flag is returned indicating that an error occurred. If the flag
indicates that an error occurred, methods are available to retrieve the recorded error. This is
the case for routines that return long integers.
c. The error is recorded, and nothing is returned. This is the case for routines that return no value.
The table shown below lists and summarizes the error-handling routines. Detailed descriptions and usage
examples follow.
Name Description
GetLastErrorXML() Returns a String representation of the XML formatted error message that
last occurred.
GetLastErrorMessage() Returns the error message String for the last error that occurred.
GetLastErrorWasException Returns a Boolean value indicating whether the last error that occurred
was an Exception.
The GetLastErrorXML routine returns a string representation of the XML formatted error message
that last occurred. The XML structure for this error is as follows:
<Error>
<Message>An error occurred.</Message>
<IsException>0</IsException>
</Error>
If a routine returns a long integer type, a special value of this type will be returned that indicates an error.
This value can be retrieved using the GetErrorCode()routine.
If a routine does not return a value, then the routine will record the error then halt execution where the
error occurred, and will not make any changes to the data source being operated on.
72
FileBound 7 API Manual
Project Examples
Returning a Project by Project ID
In the following example, the Project associated with the specified ProjectID is returned as a serialized
Project object.
File Examples
Returning a File by File ID
In the following example, the File associated with the specified FileID is returned as a serialized File
object.
73
FileBound 7 API Manual
Saving a File
In the following example, a new File is created and its FileID is returned and stored.
Deleting a File
In the following example, a new File is created, and using the new File’s ID (returned from SaveFile(…)),
the new File is deleted.
Document Examples
Returning a Document by Document ID
In the following example, the Document associated with the specified DocumentID is returned as a
serialized Document object.
74
FileBound 7 API Manual
In the following example, the Documents associated with the specified FileID are returned as a serialized
DocumentCollection object.
Saving a Document
In the following example, a new Document is created and its DocumentID is returned and stored.
Deleting a Document
In the following example, a new Document is created, and using the new Document’s ID (returned from
SaveDocument(…)), the new Document is deleted.
75
FileBound 7 API Manual
Workflow Examples
Routing a Document AdHoc
In the following example, the Document associated with the specified DocumentID is routed to the
specified user.
Cancelling a Route
In the following example, the routedItem associated with the specified RoutedItemID is cancelled which
cancels that workflow.
76
FileBound 7 API Manual
In the following example, the routedItem associated with the specified RoutedItemID is reassigned to the
routedItem designated by UserID. The return value of the method is the ID of the next routedItem that
was created.
Miscellaneous Examples
Retrieving Divider List for Project
In the following example, the Dividers associated with the specified ProjectID are returned as a serialized
DividerCollection object.
77
FileBound 7 API Manual
78
FileBound 7 API Manual
Also, make sure to add the FileBound.dll reference to the project from NuGet. Below are a few key
elements to the Workflow Actions.
Inside the MyAction, there is the ConfigSave function, which will be used to take the UserControl and
save all the necessary properties.
Along with this there is the ConfigScreen() function, this function is the actual function that opens the
User Control that will be used to configure the Action.
79
FileBound 7 API Manual
{
//New custom User Control
MyActionUC config = new MyActionUC();
base.ValidateContext(ShortDescription);
//Make sure your Project's fields are filled, Context should already have
your current
Context.Project.Fields.Fill();
foreach (FileBound.Field f in Context.Project.Fields)
{
config.cb_Field.Items.Add(f.Name);
}
return config;
}
The last main notable function is Execute(). This will be where the actual work is performed when
Workflow is processing.
if (Context.File == null)
{
throw new Exception("Action Error-Template Action: File is Null");
}
There are a few other items found in the Action, the first being Image16x16, which is used to return the
Bitmap Icon for the Custom Action. LongDescription will return a string that is intended to be the
summary of what the Action does while the ShortDescription will be the name of the Action displayed to
the users. Also, MyActionUC is the User Control that you will want to modify for your needs.
80
FileBound 7 API Manual
81