Extract Database Icon

Hello,

I want to extract the database icon by lotus script or java. Via the DXLExporter Class I can get the value of the database icon. But I do not know which encoding it is, so I cannot convert the following lines to a picture:

AiAgAQAA///////wD///gAH//gAAf/wAAD/4AAAf8AAAD+AAAAfgAAAHwAAAA8AAAAPAAAADgAAA AYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAHAAAADwAAAA8AAAAPgAAAH4AAAB/AAAA/4AAAf /AAAP/4AAH//gAH///AP//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAiIiIiAAAAAAAAAAAAAAI jPZmZm/IgAAAAAAAAAAIjGZmZmZmZsiAAAAAAAAAjGZmZmZmZmZmyAAAAAAACMZmZmZmZmZmZmyA AAAAAIxmZmZmZmZmZmZmyAAAAAjGZmZmZmZmZmZmZmyAAAAIZmbyL2byL2byL2ZmgAAAjGZmIiJm IiJmIiJmZsgAAIZmZiIiZiIiZiIiZmZoAADGZmYiImYiImYiImZmbAAI9mZmIiJmIiJmIiJmZm+A CGZmZiIiZiIiZiIiZmZmgAhmZmYiImYiImYiImZmZoAIZmZmIiJmIiJmIiJmZmaACGZvIiIiZiIi ZiIiIvZmgAhmYiIiImYiImYiIiImZoAIZm8iIi9m8i9m8iIi9maACPZmZmZmZmZmZmZmZmZvgADG ZmbyL2byL2byL2ZmbAAAj2ZmIiJmIiJmIiJmZvgAAIxmZiIiZiIiZiIiZmbIAAAI9mbyL2byL2by L2ZvgAAACMZmZmZmZmZmZmZmbIAAAACMZmZmZmZmZmZmZsgAAAAACMZmZmZmZmZmZmyAAAAAAACM 9mZmZmZmZm/IAAAAAAAACIz2ZmZmZm/IgAAAAAAAAAAIiMZmZmyIgAAAAAAAAAAAAACIiIiIAAAA AAAAAAAAAAIAAgAgAEAAAQABAA==

Any help would be appreciated… I’m getting crazy … A normal picture ressource is encoded with base64… but not tha database icon :frowning:

Subject: Extract Database Icon

First off, I don’t have any code example and I hardly know anything about this stuff, but …

The database icon is an element of type 2 (as found in your exported DXL.

The DTD states: "The element contains the raw data (uninterpreted and unchanged by

DXL) for a construct of a specific Domino data type, in Domino CANONICAL format,

encoded in Base64." (as found in your local xmlschemas directory)

The C API user guide explains: “Domino canonical format is defined as Intel 8086 byte ordering with no pad bytes.” (as found in the SDK).

I didn’t check with nsfdata.h (as suggested further down in the DTD), but I assume that type 2 means TYPE_ICON in C API.

Don’t know, if this is of any use for you, but the core information is: Yes, the data is base64 encoded, but no, it cannot be decoded into a common graphic format directly.

Go figure.

Subject: RE: Extract Database Icon

Thanks for your answer!

That’s the problem. It is TYPE_ICON and cannot be converted directly. I’ve read some articles and there was a discussion that it’s slightly bet the same datatype as the *.ico files. Until now I didn’t be lucky with the convertion from the string to an *.ico file…

But there has to be a way to get the image data out of the string. The NotesClient can also display the icon :wink:

A WebBrowser can display the icon with the url *.nsf/$icon

→ Can this be a solution? Can I get the stream information out of the browser?

Or is it possible to get the information out of the field “BitmapIcon” which is stored in the icon-design-note?

Subject: RE: Extract Database Icon

As I said, I have no idea. Looking at the content of IconBitmap, it is obviously just the base64 decoded version of what you get throuhg DXL, so you don’t earn much either way.

Subject: RE: Extract Database Icon

Getting the information from the browser is often the easiest solution, as the conversion to a standard graphic format is done for you.

Subject: RE: Extract Database Icon

Hey Ben!

can you give me a short tip how to get the information from the browser? Or via an URLRequest? I searched the whole evening and didn’t found a solution …

thanks!

Subject: RE: Extract Database Icon

To retrieve the database icon via URL is pretty easy: just add $icon to the database path. Like in

http://www-10.lotus.com/ldd/nd6forum.nsf/$icon

Subject: RE: Extract Database Icon

I already found this url. But how to convert the data into a file? Is it possible via an url request in java? I stuck. Can you give me the right direction to do the job?

Subject: RE: Extract Database Icon

Sorry, never did that myself. Basically, you need some sort of HTTP client that is able to retrieve the server response (the gif image) and then probably stream it into a file on your hard disk.

I have no idea, if this example database does all you need, but you might at least have a look at it (and the related articles):

http://www.nsftools.com/blog/blog-05-2007.htm