Sunday, 20 January 2013

adding voice input in siebel openUI :: Physical Render experiement


Please Note: Here we are using a webkit property. That means this feature will work only in google chrome.
Google chrome supports it's own voice search property. We can add this property to our application by adding "x-webkit-speech" in our input fields. Here we can create a physical render and implement this feature.


<!-------------------CODE Begins----------------------------!>

if( typeof( SiebelAppFacade.GoogleVoicePR ) === "undefined" ){
    SiebelJS.Namespace( "SiebelAppFacade.GoogleVoicePR" );
   
    SiebelApp.S_App.RegisterConstructorAgainstKey( "GoogleVoicePRenderer", "SiebelAppFacade.GoogleVoicePR" );
   
    SiebelAppFacade.GoogleVoicePR = ( function(){
       
       
        function GoogleVoicePR( pm ){
            SiebelAppFacade.GoogleVoicePR.superclass.constructor.call( this, pm );
            var controls = this.GetPM().Get( "GetControls" );
            var cntrl = controls[ "Last Name" ];   
            var lastNameCntrl  = cntrl.GetInputName();
            $('input[name="'+lastNameCntrl+'"]').attr("x-webkit-speech","x-webkit-speech");

        }
       
        SiebelJS.Extend( GoogleVoicePR, SiebelAppFacade.PhysicalRenderer );
       
        return GoogleVoicePR;
    }());
}


<!-------------------Code Ends------------------------------!>

21 comments :

  1. by placing this code in pr file its not working

    ReplyDelete
  2. Fixes
    -----
    1. Please make sure that your PR is registered in Manifest file, applet user property.
    2. Make sure that var cntrl = controls[ "Last Name" ]; "last name" is the name of your control.
    3. If your applet contains any browser script(Old) then please run GenB
    4. please make sure that you compiled your applet.

    ReplyDelete
    Replies
    1. We are able to see the Voice image at the field level after using this script. But when we try to speak at the mike after connecting to the System. It is giving the Error saying "No voice heard".

      Delete
    2. This comment has been removed by the author.

      Delete
    3. It is working in my system. Please make sure that
      1. Mike is working
      2. Background noise is less
      3. Chrome may get corrupted. If you can see mike symbol in your text field, this feature is enabled in your browser.

      Try this in another machine with another mike

      Delete
    4. Hye Thanks Prashanth S. We are able to see this change. :)

      Delete
    5. Hi Prasanth, good post... I tryed in my Siebel, but don't work. When I enter in applet with user property "GoogleVoicePRenderer" load only the field's but don't load data. The
      applet don't work, the fields don't show icon to MVG.
      can you help me?
      where I worng?
      Don't need PM file?

      Tks

      Delete
    6. Hi Alexandre,
      Did you try this example with a form applet? if not try with a form applet.

      Delete
  3. Hi Charles,
    I think you know the limitations of old siebel UI. High interactivity needs IE and we need to set up IE for proper rendering of UI. So the customer/End user has to use windows machine with IE. Open UI comes with a solution for this. This is using Open Standards like Ajax (Read this: 1) http://siebelopenui.blogspot.in/2012/10/what-is-ajax-and-why-it-is-in-siebel.html 2) http://siebelopenui.blogspot.in/2012/09/siebel-open-ui.html)
    this also will help you
    http://siebelopenui.blogspot.in/2012/09/siebel-open-ui.html

    It is not just CSS change. But for customizing siebel default screens, you can even edit css.
    Physical render, Physical Model allows you to control & Style all input & Its data in siebel.

    I am ready to help you, to know more, and i will share some training material & PPTs. Please provide your mail id.

    ReplyDelete
    Replies
    1. Hi Prashanth,

      Could you please send me training material and PPTs as well

      Thanks
      Ravi

      Delete
    2. Hi Ravi,
      Please give me your email

      Delete
    3. Hi Prasanth,

      If you have training material, please send it to me as well.

      Thanks,
      Rajan.

      Delete
    4. Hi Rajan,
      Please let me know your contact details (Email)

      Delete
    5. Hi Prasanth,

      Could you send to me as well?

      Thanks
      Charles

      Delete
  4. Prasanth
    I would very much appreciate if you could email me the training material at rjuneja at gmail.com

    thanks.

    ReplyDelete
  5. Hi Can we integrate mobile camera device by using javascrip code ?

    ReplyDelete
    Replies
    1. Usually browsers will not allow to access any device or files in Client's machine. If any code attempts that, that will blocked by browser. But there are some possible ways to achieve this. We could invoke & connect printer and scanner from OpenUI. But that is not the feature of OpenUI. we need the tricks of a web developer :)

      Delete
    2. hello Prasanth..Can you send training material that you were referring to me too.
      Thanks,

      Delete
  6. Hi Prasanth,
    Iam New to Siebel open UI I tried the above code,but when i added to one of my applet
    then that applet is getting disappearing on UI Side.Could you please look at it

    ReplyDelete
    Replies
    1. Hi,
      Please make Sure that your version is 8.1.1.9 / 8.1.1.10. If so, make sure that you applied this code for Form Applet.
      If your version is 8.1.1.11 /8.2.2.4 - please make necessary changes to the code.

      Delete