5 Replies Latest reply on Sep 24, 2012 2:32 PM by JasonBatzlaff

    Configurator Runtime Initialize Script

      Hello, I am investigating launching Configurator runtime via a custom app. I used the script given by Oracle to invoke off a a simple html page. I've hard coded the parameters and it works fine. Now I want to try and replace the inventory item id and org id with values passed in from a input box. I am a complete noob with javascript. Here is what I have, the commented line works, the one above doens't work. Thanks for your help


      <script language="javascript" >function init()

      Configurator Test

      var itemid;

      method="post" id="test1" name="test1">

      <p><input type="text" name="ItemID" size="20"></p>

      <input type="hidden" name="XMLmsg" value=
      <param name="terminate_msg_behavior">brief</param>
      <param name="database_id">HOLCNV</param>
      <param name="user">tdipiero</param>
      <param name="pwd">welcome1</param>
      <param name="calling_application_id">660</param>
      <param name="responsibility_id">21623</param>

      <param name="inventory_item_id">itemid</param>
      <!-- <param name="inventory_item_id">1911894</param> -->

      <param name="organization_id">150</param>
      <param name="ui_type">JRAD</param>

      <input type="submit" value="Configure" />


      <p>Click on the submit button to launch the configurator</p>

        • 1. Re: Configurator Runtime Initialize Script
          it would be difficult to achieve by java script, can you not use JSP instead?

          In javascript approach, you should have Text Input for Inventory item id, append it dynamically (on javascript invoked on button click) to rest of xml (basically update the value of hidden parameter XMLmsg) and submit the form to CZ Servlet.
          • 4. Re: Configurator Runtime Initialize Script
            I've created a Test Webpage that I have used to allow users to test OCD model prior to publishing them in a production instance. This was not an elegant solution as the data for UI DEF ID was static. As Pankaj suggests, a JSP, that dynamically renders the data in a Drop Down might be a better solution. Regardless, here is a code snippet that shows how my test file worked:

            Put the following inside the Script tags in your HTML document:

            <!--function changeValue(){
            <!-- var option = document.getElementById('filter').value;
            <!--     var modlqty = document.getElementById('modelqty').value;
            <!--     if (modlqty=="") {
            <!--          modlqty = "1";
            <!--     }
            <!--     var xmlmessage = "";
            <!--     if (option=="NULL") {
            <!--          xmlmessage = "choose an option from the list above";
            <!--     } else {
            <!--          xmlmessage = "<initialize> ";
            <!--          xmlmessage = xmlmessage + '<param name="database_id">DBID</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="user">username</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="pwd">password</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="calling_application_id">708</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="responsibility_id">resp_id</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="ui_def_id">' + option +'</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="context_org_id">validation_org</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="warehouse_id">shipping_org_id</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="operating_unit_org_id">OU</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="ui_type">JRAD</param> ';
            <!--          xmlmessage = xmlmessage + '<param name="model_quantity">' + modlqty + '</param> ';
            <!--          xmlmessage = xmlmessage + '</initialize> ';
            <!--     }
            <!--     document.getElementById('XMLmsg').value = xmlmessage;

            Then, use the following inside the Body elements of your HTML Doc. This formats the HTML with a dropdown to select a model/UI Def Id and an input box for a model quantity.

            <!--<p>Choose a model from the list below.</p>
            <!--<td>The model will be launched in a separate webpage. Be sure pop-up blockers are enabled</td>
            <!--<td>ALWAYS complete the configuration by clicking either "Cancel" or "Finish"</td>

            <!--<select name="filter" id="filter" >
            <!--<option id="NULL" value="NULL">Select a Model Below</option>
            <!--<option id="MODELA" value="11111 -- This is a UI DEF ID">Model A</option>
            <!--<option id="MODELB" value="22222 -- This is a UI DEF ID">Model B</option>
            <!--<option id="MODELC" value="33333 -- This is a UI DEF ID">Model C</option>
            <!--<option id="MODELD" value="44444 -- This is a UI DEF ID">Model D</option>
            <!--<td><input type="text" name="modelqty" id ="modelqty" ></input></td>

            <!--<form action ="http://hostname:port/OA_HTML/configurator/UiServlet"
            <!-- method = 'post'
            <!-- id="test1"
            <!-- name="test1"
            <!--     target="_blank"
            <!--     onsubmit="changeValue();">

            <!--<input type="hidden" name="XMLmsg" id ="XMLmsg" ></input>
            <!--<input type ='submit' value = 'Launch Configurator...' />

            • 5. Re: Configurator Runtime Initialize Script
              FYI...Besure to remove the comments from the code above. That was the only way I could get the forum to post the code.