Import/Export Maximo ImageLib Data via Integration Framework

In Maximo, we can upload images as attachments (DOCLINKS) which are stored as files on the server or as “profile” images which are stored as binary data inside the IMAGELIB table. Profile image is quite useful to give the user a quick view of what an inventory item or an asset/location looks like.

While Maximo allows us to upload DOCLINKS attachments via the Maximo Integration Framework (MIF), uploading images to the IMAGELIB table via MIF is not supported out-of-the-box. Therefore, to upload images, we can only do it manually one by one via the Maximo UI.

For bulk loading, if we have access to the DB server, we can write a stored procedure to read the files and import binary data directly to the database. There are two scenarios I had in the past in which this
approach doesn’t work

  • When we built mobile apps and wanted to upload data to IMAGELIB. In that case, my teammate extended a REST handler class to achieve this requirement.
  • When we needed to bulk upload images, the client did not give us access to the database

To address this requirement, we can extend the process classes of object structure (OS) to encode/decode binary data into Base64 string to deliver the data via XML or JSON format. Since this processing is done on object structure, it will support both application Import/Export and sending/receiving binary data via the integration framework’s MEAWEB API or JSON API.

To encode binary data to Base64 text string before exporting OS data, we can extend MicSetOut.class and associate it to the OS by specifying the class’s path in the “Outbound Definition Class” field. Below is the sample Java code which exports Item master data with Image:

To decode base64 string back to binary data before storing it to IMAGELIB table, we can extend the MicSetIn.class and associate it to the OS by specifying the class’s path in the “Inbound Processing Class” field. Below is the sample Java code:

Once we have the customized classes in place, it is possible to Export/Import ImageLib data using XML format or via web services. It is also quite easy to write a simple Excel/VBA program to bulk upload images via MIF without the need to have direct access to the DB server. But these are different topics and perhaps, I’ll provide examples in other future posts.

9 Comments

  1. Pavan Uppalanchu

    Can you please provide me with example how to load images through MIF It is also quite easy to write a simple Excel/VBA program to bulk upload images via MIF without the need to have direct access to DB server.

  2. Viet Tran

    You can down load the sample Excel/VBA tool in this repo: https://github.com/viettranit/ImgLibUpload

  3. Unknown

    Please provide an information on how to extend REST hadler class. We are trying to add images to the existing items and apparently REST doesn't allow updates of ITEMIMAGE structure. It rejects the POST process because ITEM already exists. Thanks in advance

  4. PrashantB

    Hi Viet , do you this configured using automation scripts and excel to export the data with images ?

  5. Viet Tran

    Essentially, this post is to prove that we can import/export data with images using MIF, thus make it possible from the front-end by the power users. Such as migrating a bunch of data from DEV/TEST to PROD. Otherwise, we have to use DB functions/feature to do it, which can only be done by technical people. However, the requirement to export ImgLib is quite rare. The most common requirement is to import image files into Maximo. I remembered posting this after a SaaS project where we didn't have access to the database, thus I tried to use MxLoader as an adhoc SQL tool to access the database

  6. Viet Tran

    Hi, you should use "Sync" or "AddChange". If you use "Add", it won't update existing items

  7. sunk818

    Hi Viet Tran – I saw the xlsm file on github and it mentions MXLITEM which is anot a default object structure. I know I have an MXITEM from Bruno's MxLoader. I wonder if there's Excel spreadsheet we can use like MxLoader that can perform the insert to IMGLIB. Are custom java classes still required, or do you think this is possible through automation scripts? I know IN Maximo 7.6.0.8 Python is 2.6 — but I ran across instructions for Oracle to insert data via Python (https://oralytics.com/2020/09/07/loading-and-reading-binary-files-in-oracle-database-using-python/) but we obviously would prefer to use any delivered API Maximo uses for best data compatibility.

    Also, what about MxLoader 7.5.2 NextGen, I was able to upload file attachments successfully. Do you think I could do the same for IMGLIB table for image blobs?

    Any thoughts?

  8. Viet Tran

    – It's the same as the MXITEM2 object structure shown in the image in this post.
    – If you use integration script as mentioned in here, you don't have to use custom java code
    – With smaller clients which I have access to the database, I would load the data directly to the database as it's the fastest method. But unfortunately, with bigger clients, we don't usually have access to the database. Using code to talk directly to the database, bypassing Maximo business layer, is also against best practice.
    – I haven't tried the new MxLoader version to upload ImgLib. The older versions (5.x or older) cannot do this. The main problem is we have to modify Maximo to decrypt base64 data as mentioned in this post. Once that's done, you can use the example Excel file to upload data, or use the code in it to modify MxLoader.

  9. Unknown

    Thanks anh kkk 😛

Leave a Reply