How to upload Image to MDM 5.5 SP3 using Java APIs

Hi,
I am trying to upload Image to Images table in MDM 5.5 using JAVA API for MDM. But. I'm not able to find particular field in Images table where I need to set the Blob object ( Image data ).
I'm not aware of the method to set the Blob, there is one for getting the Image data.
I have gone through I am not able to add images into Catalog thru java API forums posts and tried the code. But with no luck....
I think this code is for some other MDM version as the fields mentioned are not present in the Images table e.g. DataObject - this field is used in the above posts to set the Blob data but this field does not exist in Images table in MDM 5.5
Can anyone suggest the solution?
Thanks and Regards,
Mausam

Hi Mausam,
Please try the following:
// adding to a image table
// get the bytes for the image
byte[] imageBuf = readFile("C:\pic.bmp");
// setup A2iFields
fields = new A2iFields();
fields.Add(new A2iField("DataObject", new
Value(imageBuf))); // the image binary (required)
fields.Add(new A2iField("Name", new Value("pic.bmp")));
// a name for the image
fields.Add(new A2iField("OrigName", new
Value("pic.bmp"))); // the original image file name
(required)
fields.Add(new A2iField("DataGroupId", new Value(888)));
// the data group to add to (required)
fields.Add(new A2iField("OrigLocationId", new
Value(999))); // the data location of the image
(required)
fields.Add(new A2iField("Description", new Value("a
short description"))); // a short description here
// add the image
String imageTable = "Images";
catalog.AddRecord(imageTable, fields, -1, -1);
It's taken out of the API guide for SP3 (the example for method AddRecord.
Best regards,
Amit

Similar Messages

  • Image not displayed in pdf generated using Java API for Forms service

    Hi,
    I am creating a pdf document using Java API for Forms Service.
    I am able to generate the pdf but the images are not visible in the generated pdf.
    The image relative path is coming in the xml as defined below. The images are stored dynamically in the Livecycle repository each time a request is fired with unique name before the xml is generated.
    <imageURI xfa:contentType="image/png" href="../Images/logo.png"></imageURI>
    Not sure if I need to specify specify specific URI values that are required to render a form with image.
    The same thing is working when I generate pdf document using Java API for Output Service.
    As, I need to generate interactive form, I have to use Forms service to generate pdfs.
    Any help will be highly appreciated.
    Thanks.

    Below is the code snippet:
                //Create a FormsServiceClient object
                FormsServiceClient formsClient = new FormsServiceClient(myFactory);
                //Specify URI values that are required to render a form
                URLSpec uriValues = new URLSpec();
                                  // Template location contains the whole rpository path for the form
                uriValues.setContentRootURI(templateLocation);
               // The base URL where form resources such as images and scripts are located.  Whole Image path is passed in BaseUrl in the http format.
                      String baseLocation = repositoryPath.concat(serviceName).concat(imagesPath);   
                                  uriValues.setBaseURL(baseLocation);                                        
                // Set run-time options using a PDFFormRenderSpec instance
                PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
                pdfFormRenderSpec.setCacheEnabled(new Boolean(true));           
                pdfFormRenderSpec.setAcrobatVersion(com.adobe.livecycle.formsservice.client.AcrobatVersio n.Acrobat_8);
                                  //Invoke the renderPDFForm method and write the
                //results to a client web browser
                String tempTemplateName =templateName;
                FormsResult formOut = formsClient.renderPDFForm(tempTemplateName,
                                              inXMDataTransformed,pdfFormRenderSpec,uriValues,null);
                //Create a Document object that stores form data
                Document outputDocument = formOut.getOutputContent();
                InputStream inputStream = outputDocument.getInputStream();

  • Image resize : loss of quality by using Java API. What's wrong ?

    We actually have a problem with the resizing of pictures.
    We use jdk 1.4.2.
    We are trying to transform some picture from approx. 2000*1600 to 500*400.
    The result is poor (loss of colors, blur ...)
    We use an affineTransform and some renderingHints.
    There is actually no effect when we change the renderingHints parameters. Why ?
    Here's the code we use:
    import java.awt.geom.AffineTransform;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import javax.swing.*;
    public class Jpeg
        public Jpeg()
        // i  = la largeur de l'image redimensionner
        // s  = le chemin d'acces � l'image original
        // s1 = le chemin d'acces � l'image retaill�e
        public boolean resize(int i, String s, String s1)
           try
                File file  = new File(s);
                File file1 = new File(s1);
                //Parametrage de la lecture
                ImageIO.setUseCache (true);
                BufferedImage src = ImageIO.read(file);
                double d  = src.getWidth();
                double d1 = src.getHeight();
                double d2 = i;
                double d3 = d2 / d;
                if(d1 * d3 > d2)
                    d3 = d2 / d1;
                if(d3 > 0.8D)
                    d3 = 1.0D;
                int j = (int)(d * d3);
                int k = (int)(d1 * d3);
             AffineTransform  tx = new AffineTransform ();
                tx.scale (d3, d3);
                RenderingHints  rh = new RenderingHints (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                rh.put (RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
                rh.put (RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
                rh.put (RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                rh.put (RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
                rh.put (RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
                rh.put (RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                AffineTransformOp  op    = new AffineTransformOp (tx, rh);
                BufferedImage      biNew = new BufferedImage (j, k, src.getType ());
                op.filter(src, biNew);
                ImageIO.write (biNew, "jpg", new File (s1));
            catch (Exception  e)
                e.printStackTrace ();
                return  false;
            return  true;
        public static void main(String args[])
            Jpeg jpeg = new Jpeg();
            jpeg.resize (Integer.parseInt (args [0]), args[1], args[2]);
    }Here's the original picture http://193.252.12.20/bugimage/14457.jpg
    Here's the resized picture http://193.252.12.20/bugimage/bur.jpg
    Here's the paintshop pro resized picture http://193.252.12.20/bugimage/psp.jpg
    Is there another way to resize pictures ?
    Can we have a better result by using jdk 1.5.0 ?
    Thanks for your help.

    Nothing wrong - it's a feature :).
    "Loss of colours" is connected with Java embedded JPEG decoder. If you transcode to for example PNG format using any image processing program and then resize using Java then colors will be OK.
    "Blur..." is connected with bad implementation of interpolation algorithms in JDK/JRE and can't be fixed :)
    I'm close to finish developing own resizing library which produced the next results from your image (it's a very good image to test). "from_png" means that the source image is PNG.
    <b>Box interpolation</b> (also known as nearest neighbour, but it's the honest implementation, not JDK fake):
    http://www.chainline.com/Box.jpg
    http://www.chainline.com/Box_from_png.jpg
    Well-known <b>Lanczos 3</b>:
    http://www.chainline.com/Lanczos_3.jpg
    http://www.chainline.com/Lanczos_3_from_png.jpg
    Not-well-known <b>Ideal 5S</b> but one of the most qualified:
    http://www.chainline.com/Ideal_5S.jpg
    http://www.chainline.com/Ideal_5S_from_png.jpg
    And 2 interesting s.c. "sharp" filters which make the result sharpen:
    <b>Sharp Light 5</b>:
    http://www.chainline.com/Sharp_Light_5.jpg
    http://www.chainline.com/Sharp_Light_5_from_png.jpg
    <b>Sharp 5</b>:
    http://www.chainline.com/Sharp_5.jpg
    http://www.chainline.com/Sharp_5_from_png.jpg

  • URGENT:How can we submit a web page containing form using Java API?

    Dear Friends,
    I want to submit a form to a form action page resides in a web site. Then I need to get the response of the same.
    Is there any way to do this automatically by using Java API.
    Does java.net have anything?
    Thanks in advance
    Sarath

    Have you looked at a package called httpunit.
    http://httpunit.sourceforge.net/
    This allows form submission, Javascript, cookies etc.

  • How to find bpel instance in 11g based on the index values using Java APIs

    Hi ,
    In SOA10G we had option to find the instances based on the index value using Java APIs like below.
    WhereCondition criteria= new WhereCondition(SQLDefs.CX_index_1 + " = ?");
    criteria.setString(1, "indexValue");
    Locator mLoc = getLocator();
    IInstanceHandle[] foundInstances = mLoc.listInstancesByIndex(criteria);
    Please tell me how to achieve the same functionality in SOA 11G using Java APIs
    Regards,
    Saba

    I have multiple bpel in my composite. I checked in ci_indexes table and it shows the instance number of the bpel process. But the em console is showing only the composite instance number. when I opened composite instance, I could see all the bpel process with instance number in the audit trail. How can I find the the actual composite instance number that I should search for in the em console ???

  • Uploading images whit thumbnail to MDM repository using Java API

    Hello,
    can someone tell me how to upload images whit thumbnail to MDM repository using Java API?
    i get following message using setHasThumbnail(true):
    com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Ungültiger Wert für Parameter
    thanks

    You can upload images to MDM via the API, but the only way to create thumbnails is via the MDM Data Manager application which uses some embedded libraries to do the work.
    Walter

  • How to upload images in to custom table and display them in normal ABAP report?

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

  • How to upload Images in Forms 6i

    Dear all,
    How to upload images in Forms 6i and save it in database. Please anyone help me with example.
    Thanking you
    Shekhar

    why do you need an active/X for this?
    Can't you just create 2 default blocks on dept and on emp.
    Use the relationship wizard to define the relation. and set the number of records displayed for the emp block to 10?
    This will give you all you need with no hussle.

  • How to upload images on hard drive to iPad?

    how to upload images on hard drive to iPad?

    You can import them into iTunes then use that to get them onto your iPad.
    You can download the iCloud control panel and use photo stream to get the photos onto your iPad
    You can e-mail them to yourself and them save them from that e-mail
    You can upload them to something like dropbox and then download them onto your pad from there.

  • How to upload image files in sqlserver from jsp

    hi friends,
    i want to upload images to sqlserver how will i store url of the image or dorectly store the file in binary format, if we store in related path,plese give some ideas on store that paths in data base and how we store that image files in user directories.
    bye

    hi jay , I know that concept , but i dont know how to upload image files to server Please help me
    here i am giving my problem
    If any user register with site, he has the option to upload his image to the site, so i am using in html file upload option, But i dont know how to store that iamge into the server
    please give me suggestion
    regards
    sudhakar

  • How to upload image using JSP

    hi,
    i am confronting a problem how to upload image from local PC to web server . I am using Tomcat 4.0
    please help me by sending code
    thanks

    Hi,
    Here is the solution for uploading images and displaying images. I am using struts with JSP, so this code has a Action and ActionForm class. You can put the same code in Java Beans or Servlet class to run it. This code has two JSP files - one for Upload (upload.jsp)and other for Image(image.jsp) display. It has a Servlet also to display the image. Here is the code file wise.
    Upload.jsp **********************************************************
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="uploadAction.do" enctype="multipart/form-data" method="POST">
    <p>File to upload   
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit value="Upload" property="upload"/></p>
    <p> </p>
    <p><html:img src="image.jsp"/></p>
    <p> </p>
    </html:form>
    </body>
    </html:html>
    Image.jsp*****************************************************************
    <jsp:useBean id="upload" class="uploadtest.uploadActionForm" scope="session">
    </jsp:useBean>
    <%
         byte[] rgb=(byte[])session.getAttribute("byte");
         request.setAttribute("byArr", rgb);
    %>
    <!--
    The image data is now on the request object.
    Forward the user to the showImage servlet.
    That servlet will process and display the image data contained on the request object.
    -->
    Image is<p>
    <jsp:forward page="/showimage" />
    Struts Action Class - UploadAction.java **************************************************
    import javax.servlet.http.*;
    import java.io.*;
    import org.apache.struts.upload.FormFile;
    import org.apache.struts.action.*;
    public class uploadAction extends Action {
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
    uploadActionForm upload = (uploadActionForm) actionForm;
    try {
    int size=upload.getFileUpload().getFileSize();
    //if (image != null) {
    byte[] byteArr = new byte[size];
    //Create an input stream to read the uploaded file.
    ByteArrayInputStream bytein = new ByteArrayInputStream(upload.getFileUpload().getFileData());
    // Load the input stream into the byte Array.
    bytein.read(byteArr);
    // Close the input stream.
    bytein.close();
    // Load the byte[] into the content field.
    upload.setContent(byteArr);
    HttpSession ses=httpServletRequest.getSession();
    ses.setAttribute("byte",byteArr);
    return actionMapping.findForward("success");
    } catch (Exception ex) {
    ex.printStackTrace();
    return actionMapping.findForward("success");
    Struts ActionForm class ---uploadActionForm.java***************************************************
    package uploadtest;
    import org.apache.struts.action.*;
    import org.apache.struts.upload.*;
    import javax.servlet.http.*;
    public class uploadActionForm extends ActionForm {
    private FormFile fileUpload;
    private byte[] content;
    public FormFile getFileUpload() {
    return fileUpload;
    public void setFileUpload(FormFile fileUpload) {
    this.fileUpload = fileUpload;
    public byte[] getContent()
    return content;
    public void setContent(byte[] theFile)
    this.content = theFile;
    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    Servlet to display image --- ShowImage.java ********************************************************
    import java.io.*;
    import java.util.*;
    public class ShowImage extends HttpServlet {
    //Initialize global variables
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    byte[] rgb = (byte[]) request.getAttribute("byArr");
    if (rgb != null)
    response.setContentType("image/gif");
    OutputStream stream = response.getOutputStream();
    stream.write(rgb);
    else
    response.setContentType("text");
    response.getWriter().write("attribute byArr not found");
    This code will enable to to upload and display the image. If you know Struts, then you can write the Struts-Config.xml file by yourself. Other wise write to me, I will send you that. If you want to save the image in database, then you have to keep it as BLOB datatype is database. For database you need to send the byte array in the uploadAction.java file to database. Database will keep the image as binary.
    Thanks
    Amit

  • IOS how to upLoad image

    IOS how to upload image, how the
    receiving server,can you help me?

    Hi. The iOS library for Azure Storage is currently in planning. In the meantime, please check out the following blog
    http://chrisrisner.com/Mobile-Services-and-Windows-Azure-Storage which may help with your scenario. Thanks.

  • How to retrieve data from MDM using java API

    hi experts
    Please explain me the step by step procedure
    how to retrieve data from MDM using java API
    and please tell me what are the
    important classes and packages in MDM Java API
    thanks
    ramu

    Hi Ramchandra,
    You can refer to following links
    MDM Java API-pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49
    webinr of java API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/89243c32-0601-0010-559d-80d5b0884d67
    Following Fourm Threads will also help.
    Java API
    Java API
    Re: usage of  java API ,
    Matching Record
    Need Java API for Matching Record
    Thanks and Regards,
    Shruti.
    Edited by: Shruti Shah on Jul 16, 2008 12:35 PM

  • How to upload a video into Asset Library programmatically using server side code in sharepoint 2013

    How to upload a video into Asset Library programmatically using server side code in sharepoint 2013

    First you need to configure your asset library with video content type and then you can use SharePoint object model to upload the video files in it...
    check this link for setting up Asset library
    http://www.c-sharpcorner.com/UploadFile/54db21/asset-library-in-sharepoint-2010/ 
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/1d64a5f7-c7db-4ae0-8b0d-d0722cacf5f2/assets-library-video-files-and-c?forum=sharepointdevelopmentprevious
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • How to send records to the MDM workflow using Java APIs

    Hi All,
        Using Java APIs i want to send group/single records to the backend MDM workflows for further processing. Can this be acheived? Please provide me with some code samples if you have any
    Regards
    Suresh

    Hi,
    Just go through this URL
    https://help.sap.com/javadocs/MDM/current/index.html
    In this <b>com.sap.mdm.workflow.commands </b> will Provide u commands for managing workflows.
    I hope this helps you.
    Regards
    Nisha
    Message was edited by:
            Nisha Lalwani

Maybe you are looking for

  • Camera N8 doesn't work

    Hi, I bought a Nokia N8 in London in August 2010 and I live in Argentina now...one day, i don`t know why, the camara didn't work anymore... when i turn on the camara, it gets black and stop working the phone... i need to turn off the phone so it can

  • Removing iTunes

    How do I remove downloaded iTunes from my iPad and ensure they remain on the cloud?

  • RRI - Disable a variable selection

    Hi All, I have a requirement wherein I need to jump from summary report to the detailed report. Summary report displays calday and count. And the inputs are the calday field(mandatory) and a characteristic 'Plant'(Optional). And in detailed report, i

  • Are there known data usage problems with iPhone 4S?

    I just got my first iPhone. I barely know how to use the thing and pretty much only use it for checking my work email. I blew through 7 GB of data in 20 days. From everyone I've talked to there is no way I have done this based on my limited usage. So

  • Couldn't move MobileMe mail to iCloud this afternoon

    I just tried to do the official move from MobileMe to iCloud (having received my new MacBook Pro with Lion) and the me.com/move site keeps sending me to the Find my iPhone feature. I was just chatting with an Apple expert about it and he could not fi