5 Replies Latest reply: Apr 2, 2012 7:18 AM by Misi Mladoniczky RSS

Viewing attachment from a View form

Karthick Krishnan

Hi All,

 

As per BMC guide, attachment field is not supported in View form.

 

Is there any alternate method to acheive the same in remedy?

 

This should be accomplished without using api, as the data is to be fetched from an archived BxxxCyyyyy table which is out ARS's control.

 

Thanks in Advance

Karthick

  • 1. Viewing attachment from a View form
    Misi Mladoniczky

    Hi,

     

    The data is compressed within the BLOB, and the compression method is not a public thing.

     

    In theory, you should be able to read the BLOB into an ARFieldStruct from the BxxxCyyyyy table, and set the Original/Compressed sizes and file name from the Bxxx table.

     

    Try creating a filter plugin that populates a display-only attachment field for you with these values. I have not tested this, but hopefully the API will know that when the buffer has the same size as the compressed size, it needs to be uncompressed...

     

            Best Regards - Misi, RRR AB, http://rrr.se

  • 2. Viewing attachment from a View form
    Karthick Krishnan

    Hi Misi,

     

    Thanks for the information.

     

    Since i have the attachment table in a different database other than the arsystem database, I tried to read the attachment data from the DB using a java program(without using remedy api). But, as you mentioned its showing some encrypted data.

     

    Is there any way to decrypt/uncompress the same using remedy api?

     

    If so, what is the method and the structure to hold the same.

     

    Regards

    Karthick

  • 3. Viewing attachment from a View form
    Misi Mladoniczky

    Hi,

     

    That was what I suggested originally.

     

    1. Call the filter plugin

    2. The filter plugins retrieves the data from your external source

    3. The filter plugin assigns the retrieved data to an attachment field

      BLOB -> Buf

      OrigSize -> OrigSize

      CompSize -> CompSize

      Name -> Name

    4. The filter plugin returns the attachment field

     

    I have not looked at the Java API, but presumably the same kind of attributes are available there...

     

    I am suggesting a filter plugin, as these are easier to program than ARDBC plugins, but that might be an option. You must run something that has access to the API.

     

            Best Regards - Misi, RRR AB, http://rrr.se

  • 4. Viewing attachment from a View form
    Karthick Krishnan

    Hi,

     

    I have tried the following using a simple java api program.

     

    1. Read the data from the database BxxxCyyyyy table and assign it to AttachmentValue

     

    • AttachmentValue av1=new AttachmentValue(rs.getBytes(2));

     

    2. Put it on the Entry e1, and save the request

     

    • e1.put(536870914,new Value(av1));
    • asu.createEntry("kkArcAttRetreive", e1);

     

    I am getting the below error

    ERROR (102): Message not in catalog; Message number = 102

     

     

    Any idea on this error and how to proceed with this?

  • 5. Viewing attachment from a View form
    Misi Mladoniczky

    Hi,

     

    I am no expert on the Java API, but that will definitely not work.

     

    You need to be able to directly access the following which you CAN set in the C-API:

    - Buffer (the data from the BLOB)

    - Name (of the attachment from the BXXX table)

    - OrigSize (from BXXX table)

    - CompressedSize (from BXXX table)

     

    It is not 100% sure it will work anyway, but in the normal client C-API I think that this would be taken care of. I am assuming that the same will be true if you assign a compressed buffer in the filter API if you also supply the OrigSize and CompressedSize parameters. Or maybe it should work without the Size-attributes if those values are somhow stored within the header of the compressed BLOB...

     

            Best Regards - Misi, RRR AB, http://rrr.se