cancel
Showing results for 
Search instead for 
Did you mean: 
Joe_Kocsis
Confirmed Champ
Confirmed Champ

In OnBase you have the ability to assign icons to things like Lifecycles, Queues, Documents, Custom Queries, Folder Types, and other items. Having unique icons assigned to these different object types makes them easier to distinguish from each other and provides a visual cue allowing your users to quickly go where they want.

Previously in the Unity API we exposed the Icon property off of just the NoteType object. In OnBase 15, we’ve now exposed the Icon property on several other objects:

  • FolderTypes
  • LifeCycles
  • NoteTypes
  • PrintQueues
  • Workflow Queues
  • Scan Queues

Exposing the icon on these objects enables developers to build applications that are visually richer.  You can pull back hit lists of documents and show the icons for each one based on type. When referencing a Workflow Queue or Lifecycle, you can show the icon to visually tie it to the Lifecycle or Queue in OnBase. With this new feature you can create applications with the same visual indicators as in OnBase.

Implementation

We have added the Icon property to the objects listed above.  This property is of an Icon object type and has two different properties available off of it; this includes: a large icon (LargeIcon) and a small icon (SmallIcon).  Both of these objects return a byte array representing the bitmap assigned to the object.

Because these Icons are actually documents in the OnBase database, we also expose the LargeIconID and the SmallIconID properties off of the Icon object.  These are values of type long which represent the document handle of those OnBase documents

Example

So, “What does this look like in an application?”, you may be asking.  For my example, I will use a DocumentType to display the icon.

First, we need to create or access a DocumentType object.  I am accessing the DocumentType object by retrieving it directly, but you can create it using any of the other methods available. 

DocumentType docType = application.Core.DocumentTypes.Find(9999);

With the DocumentType object retrieved, I will then retrieve the Icon property.

Icon docTypeIcon = docType.Icon;

Now that I have the Icon object to work with, I can access the byte arrays which store the images for the icons. 

Byte[] largeDocTypeIcon = docTypeIcon.LargeIcon;Byte[] smallDocTypeIcon = docTypeIcon.SmallIcon;

We can also access the document handle (or ID) of these Icons as well. Depending on my access, I could update these icons using their handle or even delete them.

long largeDocTypeIconID = docTypeIcon.LargeIconID;long smallDocTypeIconID = docTypeIcon.SmallIconID; 

Specifics

The actual bitmaps of the Icon object are represented as a byte array (Byte[]).  I chose to not go into covering the specifics of converting these to bitmap images as there are several examples available on the internet.

I also just showed one way to access the Icon property on a Unity API DocumentType.  But, remember that you can access the Icon property from any object in the list at the top.

In Conclusion

Adding the ability to access the Icons assigned to various OnBase objects can help you create a visually striking application.  It can also help users who spend time in your application as well as OnBase since the objects can now look visually similar in both systems.

 If you any questions or comments, be sure to leave them in the comment area below