How to attach that object_library to a form using jdapi?

Hi!
I am doing a migration process from Forms 6i to Forms 10g, and I need to attach an object_library object to a specific form using jdapi. The object_library that I want to attach is the web_util object_library.
How to attach that object_library to a form using jdapi?
Thanks.

I had never used JDAPI before reading your post, but the attached code creates a minimal WebUtil-enabled form from scratch -- adapting it to update an existing form should be fairly straightforward. I've only been coding in Java for about a year, so consider this only as a starting point -- there may be better, easier ways of doing this.
import oracle.forms.jdapi.*;
public class Driver {
  public Driver() {
    /* create a minimal form */
    FormModule frm = new FormModule("JDAPI_DEMO");
    Block dummyBlock = new Block(frm, "BLK_DUMMY");
    Canvas dummyCanvas = new Canvas(frm, "CVS_DUMMY");
    Item textItem = new Item(dummyBlock, "TXT_DUMMY");
    textItem.setCanvasObject(dummyCanvas);
    /* open WebUtil object library */
    ObjectLibrary olWebUtil = ObjectLibrary.open("c:/ora10g/forms/webutil.olb");
    /* attach WebUtil PL/SQL library */
    AttachedLibrary alWebUtil = new AttachedLibrary(frm, "c:/ora10g/forms/webutil.pll");
    /* loop through each tab in object library */
    for (JdapiIterator it=olWebUtil.getObjectLibraryTabs(); it.hasNext();) {
      ObjectLibraryTab olt = (ObjectLibraryTab) it.next();
      /* loop through each object in tab */
      for (JdapiIterator it2=olt.getOwnedObjects(); it2.hasNext();) {
        JdapiObject obj = (JdapiObject)(it2.next());
        String className = obj.getClassName();
        /* handle module parameters */
        if (className.equals("ModuleParameter")) {
          ModuleParameter mp =
            new ModuleParameter(frm, obj.getName(), (ModuleParameter) obj);
        /* handle object groups */
        if (className.equals("ObjectGroup")) {
          ObjectGroup og = new ObjectGroup(frm, obj.getName(), (ObjectGroup) obj);
    frm.compile();
    frm.save("c:/jdapi_demo.fmb");
  public static void main(String[] args) {
    Driver drv = new Driver();
}

Similar Messages

  • With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?

    With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?
    I have developed a form with fields hidden by default, that become visible based on box ticked or radio button selections.
    My problem is that, when I close the form and re-open it, it comes back to it's default presentation, regardless of the information already recorded in the form (including in the now hidden fields.
    How to correct that
    Thanks in advance for any hint you can provide.

    I've had the same problem. This solved it...
    Go to the "Form properties..." in the File-menu. Select "Run-time" to the left and in the box "Scripting" Preserve scripting changes to form when saved: choose Automatically (Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms).
    Hope it works for you to...

  • How to attach Microsoft 2007 files (.docx, .xlsx) using SO_DYNP_OBJECT_SEND

    Hi,
    Would anyone know how to attach a file with extension .docx or .xlsx to an email using function module SO_DYNP_OBJECT_SEND?
    I am able to successfully attach .doc or .xls documents.
    The problem stems from the fact that the packing list field 'file_ext' takes a 3-character file extension.  This will not work for .xlsx or .docx since they are 4-character extension.
    I found a few suggestions that said I have to add the filename to the attachment header table....like this:
    data: wa_content TYPE soli.
    CONCATENATE '&SO_FILENAME=' lv_filename INTO wa_content.
    APPEND wa_content TO gt_att_head.
    I then pass gt_att_head to fm 'SO_DYNP_OBJEC_SEND'.
       CALL FUNCTION 'SO_DYNP_OBJECT_SEND'
         EXPORTING
           object_hd_change = l_title
           object_type      = 'RAW'
           raw_editor       = abap_true
           starting_at_x    = '5'
           starting_at_y    = '1'
           ending_at_x      = '120'
           ending_at_y      = '20'
           edit_title       = 'X'
           external_commit  = abap_true
         TABLES
           packing_list     = gt_packing_list
           att_head         = gt_att_head
           att_cont         = gt_total_att_cont
           exclude_fcode    = i_exclude_fcode
         EXCEPTIONS
           object_not_sent  = 1
           owner_not_exist  = 2
           parameter_error  = 3
           OTHERS           = 4.
    However, when I try to open an .xlsx file, I get the warning:
    "Excel found unreadable content in 'TestFC2.xlsx'. Do you want to recover the contents of this workbook?  If you trust the source of this workbook, click Yes."
    Has anyone else encountered this problem and found a solution?
    Thanks,
    Jennifer

    Hi Andrés,
    Thank you for the suggestions.  I did as you said, but it still did not work.
       DATA: wa_content TYPE soli.
       CONCATENATE '&SO_FILENAME=' lv_filename INTO wa_content.
       APPEND wa_content TO gt_att_head.
       CLEAR:wa_content.
       wa_content = '&SO_FORMAT=BIN'.
       APPEND wa_content TO gt_att_head.
    I am already sending the obtyp as 'EXT' in the packing list.
    * Static data
       gs_packing_list-file_ext = lv_ext.
       gs_packing_list-transf_bin = 'X'.
       gs_packing_list-objla = sy-langu.
       gs_packing_list-objtp = 'EXT'.
       gs_packing_list-objdes = lv_filename.
       gs_packing_list-objnam = 'Attachment'.
       gs_packing_list-head_start = 1.
       gs_packing_list-head_num = 1.
    I can see that the document is attached but when I open the XLSX document, I get the error about unreadable content.
    Any further suggestions are appreciated.
    Thank you,
    Jennifer

  • How to process (populate & merge) XFA PDF Forms using Adobe library in Java

    We have the XFA Forms (.pdf) created in Adobe LiveCycle designer 8.2 ES. We have the following requirement :
    1. We need to populate data in those forms using standalone Java programs.
    2. We need to merge the populated forms and create a single PDF out of these forms, using standalone Java programs.
    Can both of these be done using Adobe PDF Library or Acrobat SDK?
    What is the difference between Adobe PDF Library or Acrobat SDK?
    We already have the licensed version of Adobe Acrobat Professional 9 with LiveCycle Designer 8.2 ES. Where can I get the relevant Adobe Java APIs from?
    Can someone provide some sample code that could be used for the above requirements?
    Please provide your inputs on these. We have been using IText, but facing some limitations in that recently.

    The answer looks quite clear, and the conclusion is essentially simple: Don't use LiveCycle Designer.
    Keep in mind that LiveCycle Designer originated as design tool for the according servers (that's way back in JetForms's days). For reasons I still can follow, Adobe decided to thow this design tool after any Acrobat Pro for Windows buyer. And the forms industry is now suffering from the mess that created.
    Also, keep in mind that the term "Server" is used here as "service providing application".
    Rants aside, was there a specific feature making you chose XFA (aka LiveCycle Designer)? Knowing these reasons can help us finding suitable workarounds.
    HTH.
    Max Wyss.

  • How to attach files while Creating shopping cart using FM- BBP_PD_SC_CREATE

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

  • How to attach a file to a mail using htmldb

    Hi all,
    can u help me how to attach a file in htmldb.
    iam able to send a mail using the inbuilt package but unable to attach a file.
    advance thanks in helping out.

    The APEX_MAIL package doesn't support sending emails with attachments.
    See Send E-Mail with attachment from HTML DB for some alternatives.

  • How to attach a movie to the form

    hi all,
    can anyone help me to attach a short movie (avi, mpeg etc.) to the form

    What do you mean by "attach"? You could use the HOST builtin to invoke the media player. Or you could write a JavaBean which can play movies and embed that in your Forms application.
    Regards,
    Robin.

  • How to validate that XML is well-formed?

    I have an "Any XML Service" on Oracle Service Bus (version 11.1.1.4) that I would like to have validate that the input is well-formed XML. There is no DTD or XSchema to apply -- it can be any generic well-formed XML. I didn't see a way to do it with a Validate Action. Is a Java Callout my only option?
    Thanks,
    Doug Newton

    That's interesting...
    Try creating a xquery expression using fn-bea:inlinedXML(), it doesn't require XSD
    The fn-bea:inlinedXML() function parses textual XML and returns an instance of the XQuery 1.0 Data Model.
    The function has the following signature:
    fn-bea:inlinedXML($text as xs:string) as node()*
    where $text is the textual XML to parse.
    Examples:
    fn-bea:inlinedXML(“<e>text</e>”) returns element “e”.
    fn-bea:inlinedXML(“<?xml version=”1.0”><e>text</e>”) returns a document with root element “e”.
    http://docs.oracle.com/cd/E13162_01/odsi/docs10gr3/xquery/extensions.html#wp1295964
    Cheers,
    Vlad
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts)
    https://forums.oracle.com/forums/ann.jspa?annID=893

  • How to Get Blob data(In String Form) using OCCI

    Hello frnds,
    I am new to OCCI,so i hvnt that much of master in that side.
    I have one problem while handling BLOb data.
    How to convert binary form of SDO_GEOMETRY data into string format. I am able to convert data by using PLSQL block,but its take so much time to execute.So performance is the main issue.So if there is any API in OCCI which convert directly blob data into string format.
    Thanx in advance for your support,
    Nilesh.

    Have you tried reading "http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/lobs.htm#BABDEGJD" ? This explains how you can read from BLOBs into a C vector (or C++ vector of chars).

  • How to query on a single row form using only one page

    Hi APEX experts, I am just a beginner in apex and I face several problems on development. Despite that the forum helps me a lot and your answers to other people are valuable , I have stacked into something. Could you please someone tell me : if there is a way to define a single row form page based on table in which I could query and update without using a tabular page (to call the single row form). I want only to use only one page. Does APEX has this functionality? Thank you very much?

    I haven't tried it, but I am going to guess that yes it's possible (or if I were going to do this, this is what I'd try and I suspect it will work).
    If you take a moment and step back and look at what the wizard does when building a "form on a table with report", all it does is build two pages with page 1 (report overview with drill-down Edit button or link usually) calling page 2 (form) and setting the PK field on the page 2 form with an automated row fetch process and built-in DML processes. It's not that hard.
    Page 2 really doesn't care what the calling page was in order to query a single row; it just cares that ANY caller sets the primary key value for the ARF process to fetch a row. So I would just make page 2 call itself. This is what I'd do (and you might have to fine-tune little things that I might not have forseen but I think this will work).
    For the sake of example, let's say our table is PARTS and in it is a PART_ID, PART_NUMBER, PART_DESCRIPTION, PART_COST, etc. Assume PART_ID is the primary key and sequentially assigned by the DB in a trigger and is functionally meaningless to the user and is for PK purposes only. Let's assume PART_NUMBER is a unique key (although not the PK) by which the user will "know" a unique row (since the PK of PART_ID is more internal and not meaningful to the user). Assume PART_DESCRIPTION, PART_COST, etc. are just attributes.
    1. Use the wizard and build a "form on a table with report". This is just to get the handy dandy ARF process and DML processes, validations, etc. all generated for you. Let's assume the report page is Page 1 and the form is Page 2.
    2. When done, delete the report page entirely (so delete page 1).
    3. Edit the form page (page 2) and change any branch references from the nonexistent page 1 to now be page 2.
    Now here's the part where something has to set the internal P2_PART_ID field when page 2 is run. So why not set it from itself from something the user will uniquely enter?
    4. Create a P2_PART_NUMBER_FETCH item (text item is fine or if you want a LOV or whatever that's good too....whatever works. For clarity, you might even want to create a separate "search" or "query" region separate and above your existing form region to set this field apart visually so users know it's a search field. Source for this field should be "only when current value in session state is null".
    5. Created some sort of "GO" button to go along with the P2_PART_NUMBER_FETCH field.
    6. Make sure none of your existing post-submit processes fire when GO is pressed (edit all of the computations and validations and processes and ensure that they have conditions such that they do not fire when the submit value is "GO", so like a PL/SQL expression and set to v('REQUEST')<> 'GO').
    7. Add a new validation to your page that only fires when GO is pressed. Have it validate only when GO is pressed. Have it validate that P2_PART_NUMBER_FETCH is not null.
    8. Add a new PL/SQL process to your post-submit processing that only fires when GO is pressed. Have it look up to the database based on P2_PART_NUMBER_FETCH and get the PART_ID that corresponds to the part number the user entered and set the part number, something like this (even better for style and reusability if you embed this in a DB package function and call it):
    SELECT part_id
    INTO :P2_PART_ID
    FROM PARTS
    WHERE PART_NUMBER = :P2_PART_NUMBER_FETCH;
    9. Not sure if the branches that were generated will suffice for this (might need to add a new one...review what you have and see) but the bottom line is that the page should branch to itself (page 2) and not clear the cache.
    10. When the page repaints, since :P2_PART_ID is now populated in session state (again, page 2 should not care how it got populated...only should care that it did get populated by anything (including itself)), the automated row fetch (ARF) should fire and query up the row from the database for editing.

  • How would I create an assembly of forms using only form names?

    I want to create an assembly of forms by passing only the names of the forms stored in the LC repository to the Assembly service. How would I do that? Is the assembly service the correct service to use in this case? Thank you.

    String classname = "Abc.class";
    Class class = Class.forName(classname); // catch ClassNotFoundException
    Object object = class.newInstance(); // catch InstantiationExceptiion
    MyIntrface myInterface = (MyInterface)object; // catch ClassCastException

  • How can I encrypt/decrypt data in Forms using a specified Package?

    Hi All,
    I have searched in the Internet for ecnrypting/decrypting data in Forms.
    That is when I want to query the data outside the Form Application it will be encypted, otherwise if I want to query it in the form application it will be dycrypted
    I found this package:
    CREATE OR REPLACE PACKAGE Encrypt_pkg AS
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2;
    END Encrypt_pkg;
    CREATE OR REPLACE PACKAGE BODY Encrypt_pkg AS
    -- All VARCHAR2 inputs are padded to multiples of 8 charaters,
    -- with the encryption key also being a multiple of 8 charaters.
    -- The encryption key and padding characters can be altered to suit.
    g_key RAW(32767) := UTL_RAW.cast_to_raw('12345678');
    g_pad_chr VARCHAR2(1) := '';
    PROCEDURE padstring (p_text IN OUT VARCHAR2);
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW IS
    l_text VARCHAR2(32767) := p_text;
    l_encrypted RAW(32767);
    BEGIN
    padstring(l_text);
    DBMS_OBFUSCATION_TOOLKIT.desencrypt(input => UTL_RAW.cast_to_raw(l_text),
    key => g_key,
    encrypted_data => l_encrypted);
    RETURN l_encrypted;
    END;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2 IS
    l_decrypted VARCHAR2(32767);
    BEGIN
    DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input => p_raw,
    key => g_key,
    decrypted_data => l_decrypted);
    RETURN RTrim(UTL_RAW.cast_to_varchar2(l_decrypted), g_pad_chr);
    END;
    PROCEDURE padstring (p_text IN OUT VARCHAR2) IS
    l_units NUMBER;
    BEGIN
    IF LENGTH(p_text) MOD 8 > 0 THEN
    l_units := TRUNC(LENGTH(p_text)/8) + 1;
    p_text := RPAD(p_text, l_units * 8, g_pad_chr);
    END IF;
    END;
    END Encrypt_pkg;
    ** Now How can I use this package to encrypt/decrypt data in the form as I said Plz???

    <p>Read this article and go to chapter 2.3.2.</p>Inserts, Update and Delete orders are managed by a stored procedure. In the sample dialog, the Select is handled by the emp_pkg.emp_query() stored function:
      PROCEDURE emp_query(emp_data IN OUT emptab) IS
        ii NUMBER;
        CURSOR empselect IS
          SELECT empno, ename, job, sal, comm FROM emp
           ORDER BY ename ;
      BEGIN
        OPEN empselect;
        ii := 1;
        LOOP
          FETCH empselect INTO
            emp_data( ii ).empno,
            emp_data( ii ).ename,
            emp_data( ii ).job,
            emp_data( ii ).sal,
            emp_data( ii ).comm;
          EXIT WHEN empselect%NOTFOUND;
          ii := ii + 1;
        END LOOP;
      END emp_query;In your case, all you have to do is th use your decrypt() function in the cursor definition:
        CURSOR empselect IS
          SELECT decrypt(empno), decrypt(ename), decrypt(job), decrypt(sal), comm FROM emp
           ORDER BY ename ;
    ...For Insert and Update events, use the crypt() function in the related stored procedures.
      PROCEDURE emp_insert2(t IN emptab) IS
      BEGIN
        FOR i IN t.first..t.last LOOP
         INSERT INTO emp (empno, ename, job, sal, comm)
         VALUES(crypt(t(i).empno), crypt(t(i).ename), crypt(t(i).job), crypt(t(i).sal, t(i).comm));
         END LOOP ;
      END emp_insert2;Idem for the Update procedure.
    Francois

  • SSO and how to Managing User Roles/Privileges with Forms using Oracle db

    We are in the process of implementing Oracle Application Server SSO with our custom Forms application using Oracle database -- all 10.2.0.1.0 version.
    In our Forms Applications, we have about a dozen roles we have assigned to various users. We need to identify each user using our Forms because we are using the GLOBAL USER throughout the application.
    Questions:
    -- Do we have to create users/passwords in both OID and application database?
    -- Is there a way to easily manage the user and passwords between SSO and Forms App/database in one place? For example, how does a user change their password once, but actually change it in both the database and SSO?
    Any advice and/or direction would be greatly appreciated.
    Thank you,
    Mika
    Edited by: user11846198 on Sep 1, 2009 1:41 PM
    Edited by: user11846198 on Sep 1, 2009 1:53 PM

    Yes, you can have global roles in the DB and assign this roles to specific OID users, and the will heritage the privilages, you can do this using Oracle Identity Management Web Tool http://hostname:7777/oiddas is not complicated.
    Greetings.

  • How to upload data from excel to form using webutil

    Hi,
    In the sample provided by Oracle
    http://www.oracle.com/technology/products/forms/htdocs/webutil/howto_ole.html
    Note 247606.1 How to Copy Records From a Form Into Excel
    It shown the methods of how to copy data from form to excel but is there any sample to provide the step on how to read the cell from excel into Form in 10g.

    declare
    args client_ole2.list_type;
    application client_ole2.obj_type;
    vworkbooks client_ole2.obj_type;
    vdoc     client_ole2.obj_type;
    vworksheet     client_ole2.obj_type;
    vrange               client_ole2.obj_type;
    begin
    -- create app object
    application := client_ole2.create_obj('Excel.Application');
    client_OLE2.SET_PROPERTY(application, 'Visible','True');
    -- get workbooks object
    vworkbooks := client_ole2.get_obj_property(application, 'Workbooks');
    -- and open a file
    args := client_ole2.create_arglist;
    client_ole2.ADD_ARG(args, 'c:\tp_ae.xls');
    vdoc :=client_ole2.INVOKE_OBJ(vworkbooks,'Open',args);
    client_ole2.destroy_arglist(args);
    -- get a worksheet object
    -- for this to work you need to know the sheet name or its index
    args := client_ole2.create_arglist;
    client_ole2.ADD_ARG(args, 1); <-- name or index
    vworksheet := client_ole2.get_obj_property(vdoc,'Worksheets',args);          
    client_ole2.destroy_arglist(args);
    -- get a range object which in this case is just a cell
    -- for this to work you need to know the cell coordinates
    args := client_ole2.create_arglist;
    client_ole2.ADD_ARG(args, 'B6');          
    vrange := client_ole2.get_obj_property(vworksheet,'Range',args);
    client_ole2.destroy_arglist(args);
    -- and here you get the value
    message(client_ole2.get_char_property(vrange,'Value'));
    -- release objects          
    client_ole2.release_obj(vrange);
    client_ole2.release_obj(vworksheet);
    client_ole2.release_obj(vdoc);
    client_ole2.release_obj(vworkbooks);
    client_ole2.release_obj(application);
    end;

  • How to print a signature in Adobe form using PCL - HELP!

    Hello,
    I'm using Adobe LiveCycle and I'm trying to get my form to print a signature at the bottom right on the given signature line. Our HP LaserJet printer has a SIMM installed which contains the signature in digitized form.  I need to issue a hexadecimal instruction using PCL which contains the code that tells the printer to print the stored signature. I know this is doable in SAPscript, but is it doable in Adobe??? 
    Thank you,
    Eileen

    Hi Eileen,
    I think it is handled differently in Adobe forms as here all the print data is created by ADS.
    See the document Digital Signature Setup at:
    www.service.sap.com/hrin -> Media Center -> Key Documents
    This decribes the process.
    The link below and SAP Note 1168740 also contain information.
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/1ca382f3ec5873e10000000a11466f/frameset.htm
    Regards,
    Aidan

Maybe you are looking for