Converting .bin files

DoodleDoodle Ronald Pilcher
edited January 27, 2015 in Documentum Developer Forum

I have a large amount of .bin files within Applicationxtender and need to automate converting them from .bin to pdf. Any suggestions?

«1

Comments

  • edited June 17, 2011

    Your question has been moved to the Documentum community where it has a better chance of being seen by those who might know the answer.

    If it requires a programmatic solution, we can move it to the Documentum Developer community for their advice.

  • DoodleDoodle Ronald Pilcher
    edited June 17, 2011

    Please move it and Thank you.

  • edited June 17, 2011

    Moved to Documentum Developer

  • DoodleDoodle Ronald Pilcher
    edited June 21, 2011

    Alan, Do you know of any white paper that might discuss this topic in detail? I can't beleive I am the only one that has run into this problem. Please advise.

  • edited June 21, 2011

    I don't know... I manage the EMC Community Network, and have never used ApplicationExtender.

    Do you have access to the EMC Support Forums? (Currently requires a Powerlink account).  If so, we can move your message there and perhaps someone with experience has some suggestions.

  • edited June 22, 2011

    Thing is that a .BIN file can contain anythong. Usually, the best to transform as file is to use the application that created it.

    Once you have the application, then you could create a plugin for DTS/ADTS to handle the PDF transformation or something like that

  • DoodleDoodle Ronald Pilcher
    edited June 22, 2011

    The original file was created by Applicationxtender aex file extension. Do you have suggestions on a mass conversion of these records or a utility that can be used for converting these files??

  • DoodleDoodle Ronald Pilcher
    edited June 22, 2011

    Another thought, I have files in Applicationxtender that I need to convert into jpeg,tif,gif or pdf image. Something readable. Is there a utility I can use within the Applicationxtender to perform this function?

  • edited June 22, 2011

    ApplicationXtender doest not change the content of file, it just renames the file with .bin extension.  AX db contains the file type and you can just rename them to respective file extensions.

    if you need more help, let me know, I did AX migration to Documentum.

    Thank you

    Kulveer Singh

  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    So, AX keeps the files and you can rename them in pdf format?? If that is the case> Is there a utility  that you can use to rename a large quanity of the files? Thanks for the help.

  • edited June 23, 2011

    I dont understand your requirement, my requirement was to move all content with meta-data to the Documentum. I created subtype of document to create custom object and exported the meta from AX DB to these attributes and attached those documents after renaming the file extensions.

    Please send me your requirement. I can send you the java code which you can run from console.

    Thanks

    Kulveer Singh

  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    My requirements:

    I have a large amount of files in the AX system that need to be converted, so I can import into another system. The system that I am importing into, requires jpeg, pdf or tif images. I am not converting to Documentum. I need to convert the files in the AX system to the formats listed above in a large batch conversion.

  • edited June 23, 2011

    First step to do AX migration is to understand AX DB schema

    There are OOB tables which contain info about the docid and docid is used to get the filesystem path by doing this formula.

    This function will return you the path of file from filesystem by providing docid of each document. Docid will be querid from the table and they have objectid and docid , docid tells you the current document attached to the record in AX but still you have to do some research on your schema in DB to understand, how your AX is designed and architected to find out docid from tables.

    Tables commonly used are ae_dt2  ,ae_dl2

    public String createDocumentPathFromDocId(int docId) {
    StringBuilder objSBuilder = new StringBuilder();
    String baseSourcePath = ConfigLoader.INSTANCE.sourceDocumentPath;
    // C:/ApplicationXtender/XYG.
    // INSTANCE.
    // sourceDocumentPath
    // ;
    objSBuilder.append(baseSourcePath);
    int firstLevel = (docId) / (1024 * 1024);
    objSBuilder.append("\\" + Integer.toString(firstLevel));
    int secondLevel = docId / 1024;
    objSBuilder.append("\\" + Integer.toString(secondLevel));
    objSBuilder.append("\\" + Integer.toString(docId) + ".bin");
    return objSBuilder.toString();
    }
    Once you get this path by queries this table, you can use java class for copy these file to some particular folder and rename them using standard java code on target folder.
    Please let me know if it helps. Because i dont know how is your AX app is designed, otherwise, i can write some utility for you  to rename it . I used MS JDBC driver to connect with AX DB in java code to query the AX tables and get docids from those tables and construct this path and rename them.
    Thanks
    Kulveer Singh
  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    Thank you but a few other questions. Do you know if AX has a utility to export into another file or folder? Keeping the images the same and in the same format. Just merley exporting the raw data from one place to another.

  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    I should have waited before I commented before. I have these files in a .bin format in a folder on our network. Now, I need to convert from .bin to pdf or rename the extension to pdf etc. Your thoughts.

  • edited June 23, 2011

    You can use MOVE online or Migration Wizard which comes with AX.

  • edited June 23, 2011

    Use this java code for renaming all the files in Folder

    /**
         * Rename all the files and subdirectories in a
         * specified directory.  The new name will be the
         * old name with the value of the addPrefix argument
         * prepended.  The method returns the number of files
         * that it managed to rename, or -1 if the directory
         * was not found or could not be read.
         */
        public int renameFilesIn(String dir, String addPrefix)
        {
            File dirFile;
            File oldfile, newfile;
            String newname;
            String filenames[];
            int i, count;
            dirFile = new File(dir);
            if (!dirFile.exists() || !dirFile.isDirectory()) {
                  return -1;
            }
            filenames = dirFile.list();
            for(i = count = 0; i < filenames.length; i++) {
                // must skip . and .., cannot rename them
                if (filenames[i].equals(".")) continue;
                if (filenames[i].equals("..")) continue;
                // create a File object for existing file
                oldfile = new File(dirFile, filenames[i]);
                // next line creates the new name
                newname = addPrefix + filenames[i];
                // create a File object for new name
                newfile = new File(dirFile, newname);
                // attempt to rename existing file
                if (oldfile.renameTo(newfile)) count++;
                else {
                    System.err.println("Unable to rename " +
                                         oldfile);
                }
            }
            return count;
        }
  • edited June 23, 2011

    I have one quesiton for you .

    All AX files are named like this

    123456.bin

    123457.bin

    .....

    How do you know that 123456 is pdf or tiff or jpeg.  That is why i was suggesting you to get this file extension from the DB which is stored there . So that when you get that file, you get the corresponding file extension and can rename accordingly

    Let say that 123456 is pdf than i can write a utlitity to rename it like 123456.pdf and so on.

    But if alll the bin files are of one file extension than you dont need any info from DB tables.

    I hope , that clears little confusion you have.

    Thanks

    Kulveer Singh

  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    Kulveer, All my files are in this format 78.BIN or 11230.BIN

  • DoodleDoodle Ronald Pilcher
    edited June 23, 2011

    Kulveer, None of the files are in jpeg,pdf or tif yet. I need to rename or convert them first. I would prefer them being in pdf format.

  • edited June 23, 2011

    Run the attached jar file from the command prompt and pass the following arguments, it will rename it all

    Argument 1= Folder path ,example C:\myfiles or network path  example \\mynetowkrmachine\Shares\Everyone

    Argument 2= file extension example .pdf

    Go to Command prompt run this command

    First copy the rename.jar file to the c drive

    rename.jar  C:\myfiles .pdf

    It will rename all files in that folder to pdf extension without chaning any name of file , it will only change the extension of files.

    Please let me know if you face any problem .

    Thanks

    Kulveer Singh

    PS - But i am still doubtfull if you understand your requirement clearly. Let me raise one point here, AX doesnt convernt any file to any other format, it just keeps the orignal file in file system but only renames them into .bin files. I am still doubtfull if this utility will be useful to you unless all the  .BIN extension files are pdf originally .

  • DoodleDoodle Ronald Pilcher
    edited June 24, 2011

    Kulveer, Thank You for your help. The files in .bin format were renamed to jpeg and look good. Now I have a problem. In Applicationxtender the files are keyed by all types of identifiers but the files are just randomly numbered which in return does not tie back to a identifier. Basically, I have raw images and no identifier to tie back too.

    Since Applicationxtender identifies these by keys. I am trying to see what or how I can tie the image back to a unique identifier within the naming of the file.

    Example: File 021.jpeg are the raw images- Tie it to SS# within the raw document.

    Is there a way to pull a specific identifier from the raw documents? Not sure but wanted to ask.

  • edited June 24, 2011

    I dint get your question clearly. Let me rephrase as i understood.

    AX keeps the relationship in the table in AX DB.  That can be retrieved by query and every query has the name of these images for example

    Name of each bin file is same as docid in the AX DB so we have relationship of file name with the record using docid column from the table.

    Do i understand you correctly? Becuase without AX DB, you cannot get any info from File itself, because file only keeps the docid and has no information relation with meta-data.

    Please clarify.

    Thanks

    Kulveer Singh

  • DoodleDoodle Ronald Pilcher
    edited June 24, 2011

    Yes, You are correct. I have to have something that ties the files back to each other.

  • edited June 24, 2011

    Do you have access to AX DB than i can send you query which can get you the docid for each record and you get concatenate any column value to docid  ?

    Its not that big problem , just ask the AX DB access from your AX team or server team.

    Thanks

    Kulveer Singh

  • edited June 24, 2011

    Kulveer,

    This discussion is a wonderful example of ECN members helping each other.

    Thanks so much for your subject matter expertise and your willingness to share.

    Alan Z.

    ECN Team.

  • DoodleDoodle Ronald Pilcher
    edited June 24, 2011

    I just recieve access to the db. Thanks

  • edited June 24, 2011

    You can use SQL Server 2000 Driver for JDBC to connect with your DB if it is SQL server and most probably it would be SQL server and than you run your java program to get info from your local system by running java console program.

    There are few tables which will help you get what you want .

    Tables names

    1- ae_paths- tells the path of content files

    2-ae_apps- tells the names of application in AX.

    Ae_Apps contains the name of all the applications designed in AX and from this table, you will know which tables contain your meta-data for your application.

    Select * from ae_apps

    Check your application, note down the table names and than do select query on those tables.

    Ae_DTX and Ae_DLX  where X varies from 0-N based on number of applications.

    example ae_dt1 and ae_dl1 .

    ae_dt1 contains one field called docid, which will give you the relation key between AE_DT1 and AE_DL1 and from AE_DL1 , you can get the objectId which is the actual name of the content file but , it also contains other information .like page num, version.

    Let me knwo if you need any other pointers.

    Thanks

    Kulveer Singh

  • DoodleDoodle Ronald Pilcher
    edited June 24, 2011

    Kulveer, Thank You very much. I will let you know how things turn out. I appreciate all of your help and time.

  • edited January 27, 2015

    Hi Kulveer -

    If all of the files for an AX application are not tiff or pdf is there an indicator in the database to tell the file type?  For example, I found the formatid field but in the case of the AX application it is just a NULL value or a 0.  I had thought that would indicate the type, but I found files in this AX application to be both tif and pdf even though the formatid value was always NULL.

    I am thinking that the only way to assign the format ext to the proper mime type is to open the file and look at the first few bytes to see if it is a PDF or TIFF.

    Do you know of a different database location for the format?

    Thank you.

    Christine

Sign In or Register to comment.