1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Yahoo YUI

Discussion in 'Oracle Webcenter Suite (formerly Oracle ECM)' started by idcChris, Aug 22, 2011.

  1. idcChris

    idcChris Active Member

    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    90
    Location:
    Germany
    Hello,

    Is there anyone who use the YUI to do some custom functions? I have a question regarding the ACLs in 11g.

    I want to use the ACL function like it is, but set the value depending an other metadata.

    Standard function for ROLE ACLs: User enter the ACL name to the input field; a YUI AJAX function requests the role from the table; then the user select the role and push the button add role. The function behind the button is (onclick="javascript:idc.security.util.doAccessListAdd('xClbraRoleList')") where xClbraRoleList' is the role list metadata field.

    What I did is to fill in the meta data input field triggered by java script event from out meta data and execute the function behind the button idc.security.util.doAccessListAdd('xClbraRoleList'), but then I got an error. Something has to be done in background before.

    I someone familiar with this yui java script functions or dose anyone have a documentation for the UCM yui java script code?

    Thanks,
    Christoph
     
  2. idcChris

    idcChris Active Member

    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    90
    Location:
    Germany
    And there is the solution:

    // get acl by meta data name
    acl = idc.security.util.getAccessList('xClbraRoleList');

    // create a parameter array
    var name = "The ACL Name";
    var priv = "R"; // R=read; W=write ...
    var param = new Array(name, priv);

    // make a new ACL item
    var item = acl.makeItemFromParams(param, false);

    // add item to the ACL
    acl.addItem(item);

    // set item privileges to force update acl list
    acl.togglePrivilege(name, priv);

    That's it!

    Hope it is not only helpful for me.
     
    dcell59 and Sadik like this.
  3. dcell59

    dcell59 Forum Advisor

    Messages:
    103
    Likes Received:
    18
    Trophy Points:
    260
    Thank you for posting this. So many people come here and ask questions and then never come back with their solution, or even answer questions in the discussion. I wish I could help more, but most of my knowledge is limited to the Desktop Integration Suite stuff.
     
  4. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Absolutely agree...