DPS: transform attribute value - more than sub-string - more like awk/sed

We have been working on using DirProxy to transform telephoneNumber from "(XXX) YYY-ZZZZ" format to a "Y-ZZZZ" for our VoIP call manager and and have been successful.
How we find out that our VoIP phones have feature that lets users search by phone number. The problem is that there is no way to input a dash (-) character on the phone so we would like to be able to translate from the "(XXX) YYY-ZZZZ" format that is stored in LDAP to "YZZZZ",
Anyone have suggestions on how to do this? (We know we can create a local attribute in the LDAP master in the format YZZZZ and have DPS return that attribute as telephoneNumber, but we are hoping we can do the transformation on the fly.)
Thanks.

I'm on the roads for a few weeks and have limited bandwith but here is what I did recently with the DPS version not released yet. Hope this works with DPS 6.3
I created 3 transformations and associated them with the dataview, assuming phoneNumber looks like (XXX) YYY-ZZZZ
In the example below, reworked number is returned in attr yz
- step1 : extract trailing Y
- attribute name : y // temp attr
- model : mapping
- transformation: add value
- viewValue : substring(${phoneNumber}, 7, 8)
- internalValue: ${xxxx} // dont care
-step2 : extract ZZZZ
- attribute name : z // temp attr
- model : mapping
- transformation: add value
- viewValue : substring(${phoneNumber}, 10)
- internalValue: ${zzzz} // dont care
- viewValue : substring(${phoneNumber}, 7, 8)
- internalValue: ${xxxx} // dont care
-step3 : reconstruct
- attribute name : xz // temp attr
- model : mapping
- transformation: add value
- viewValue : ${y}${z}
- internalValue: ${y}${z}
Note that this would work for searches only, and when the reworked attr is not present in the search filter.
Hope this helps
-Sylvain

Similar Messages

  • How to transform attribute values in OIM?

    I need to transform the values received for OrgUnit to AD format and then perform provisioning.
    Example: I receive OrgUnit: it/admin/oracle/com.
    I need to convert it to the following AD format before provisioning user to the correct OU
    OrgUnit: ou=it,ou=admin,dc=oracle,dc=com
    Question: Do I have to write java code to perform this transformation or can I create a lookup table that maps all expected OrgUnit values to the AD format values and have AD read that lookup table. Any thoughts on performing this transformation using OIM features instead of java code are appreciated.
    Thanks!

    Done.
    Code can be found below in case anyone else has a need for this or something similar.
    Best regards
    /Martin
    import java.util.*;
    public class ADPrepop {
         public ADPrepop(){
         public static void main(String[] args) {
              ADPrepop popper = new ADPrepop();
              String trans= popper.orgUnitTransformer(args[0]);
              System.out.println("Result="+ trans);
         public String orgUnitTransformer(String input){
              String result="";
              int counter=0;
              StringTokenizer toker = new StringTokenizer(input,"/");
              if(toker.countTokens()!=4){
                   System.out.println("Malformed input. Does not contain four tokens, i.e. it/admin/oracle/com");
                   return "ERROR:MALFORMED_TOKEN";
              while(toker.hasMoreTokens()){
                   if(counter==0|counter==1){
                        result=result+"ou="+toker.nextToken()+",";
                        counter++;
                   if(counter==2){
                        result=result+"dc="+toker.nextToken()+",";
                        counter++;
                   if(counter==3){
                        result=result+"dc="+toker.nextToken();
                        counter++;
              return result;
    }

  • How to set a attribute value of a sub node binded to a table.. pls respond.

    Hi friends,
    I have context defined like this.
         Head_node ( table 1)
              Item_node ( table 2, sub node ).  ( now this im saving in global internal table).
    so now when i hit save button, im passing my internal table (it has col1- sales order no, col2 item details(table type, which can have more than one record) to a FM, to create sales order.
    My sales order is getting saved.
    But the function module will return some new values (like sales order number, item number etc).
    Now i want these values to be updated in my context.
    Meaning whenever after that i do get_attribute, i should get these new (sales order no, item no ) also.
    I dont know how to set the context values of sub nodes , so im missing these values.
    kindly respond back to me..
    thanks in advance,
    Niraja

    Its very simple.
    Follow these steps. e.g you want to get the new sales order number. Define a attribute in ur node (or set of attributes in ur case as per reqruirement) say new_so_number.
    Check your FM, if its returning new_so_number then it's fine, otherwise you have to change the FM to return the new_so_number or you have to get from db table somehow, which best suites your req.
    So once you have new_so_number after calling the FM, say in lv_new_so_number field. Then write this code to set the attribute (change the variables as per your context attributes)
    DATA lo_nd_head TYPE REF TO if_wd_context_node.
      DATA lo_el_head TYPE REF TO if_wd_context_element.
      DATA ls_head TYPE wd_this->element_head.
      DATA lv_new_so_number LIKE ls_head-new_so_number.
    * navigate from <CONTEXT> to <HEAD> via lead selection
      lo_nd_head = wd_context->get_child_node( name = wd_this->wdctx_head ).
    * get element via lead selection
      lo_el_head = lo_nd_head->get_element(  ).
    lv_new_so_number = new_so_number. " (You got this as a exporting parameter of FM etc..)
    * get single attribute
      lo_el_head->set_attribute(
        EXPORTING
          name =  `NEW_SO_NUMBER`
          value = lv_new_so_number ).
    Hope it works.

  • Sort an XMLList on an attribute value?

    How do you sort an XMLList (or XMLListCollection) on an
    attribute value rather than the element content?
    Thanks,
    ...scott

    You use the Sort and SortField objects and assign them to the
    collection:
    var dummyXML:XML = <testdata><test
    field="C"/><test field="A"/><test
    field="X"/><test field="Y"/></testdata>;
    var sorter:Sort = new Sort();
    sorter.fields = [new SortField("@field")];
    var tests:XMLListCollection = new
    XMLListCollection(dummyXML.test);
    tests.sort = sorter;
    tests.refresh();
    trace("First item [" + tests.getItemAt(0).@field + "] Last
    item [" + tests.getItemAt(3).@field + "]");

  • Updating Attribute value

    I have a simple XML document. file.
    <result success="TRUE">
    <plan>
    <step number="0" name="SelectTransportA"/>
    <step number="1" name="SelectFlight"/>
    <step number="2" name="GetMedicalFlightAccountB"/>
    <step number="3" name="SelectFlight"/>
    </plan>
    </result>What i want is to update any "name" attribute value at runtime. I receive "number" attribute value, so on the basis of the received number, i want my name attribute value to be updated.
    Just like updating a value in hashtable or vector given an index.
    Regards.

    It depends what you want to do, Do you just want to update the file? Then XSLT is probably the easiest. Do you want to update this in memory? Then DOM's Node.setAttribute is probably best.

  • How to return more than one string?

    Hi,below is my code:
    @WebMethod(operationName = "CheckBooking")
    public String CheckBooking(@WebParam(name = "ID")
    String ID) {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Flight");
    // Statement stmt = con.createStatement();
    String b="Select Destination, Date from Flight_Booking WHERE BookingID=?";
    PreparedStatement ps=con.prepareStatement(b);
    ps.setString(1,ID);
    ResultSet a = ps.executeQuery();
    //Print the data to the console
    while(a.next()){
    return a.getString(1);
    catch( Exception e ) {
    e.printStackTrace();
    return "a";
    Actually, I would like to select Destination and Date from the database, but if I set the return result as string, then only Destination will be return,how can I modify it so that both of the Destination and Date also will be return?As I know, .Net has a return type called Dataset, in Java what should I write?
    Actually,I am writing this web services to consume it on a table from .Net,so what is the most suitable to code it so that more than one string can be return?

    Create either a list or an array and assign your values to it and return it.
    arrays
    lists

  • Setting an attribute value of a tag equal to a String variable in scope

    Hi,
    I don't think this is possible because I get an "expression not allowed" error when trying it. But long story short I'm trying dynamically set attribute values on a taglib. For example:
    <%
    String value="attributevalue";
    // set the attribute of the tag below equal to this variable value
    %>
    <tag:mytaglib name="<%=value%>"/>
    I looked at the generated jsp page and seems like the variable "value" is not in scope of the method that processes the tag. Does anyone have any ideas or can confirm that there is no way to do this. Thanks!

    You can do it.
    In your tag library (*.tld) file, have an entry as:
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>This should do the trick.
    Let us know if it worked for you.
    Thanks and regards,
    Pazhanikanthan. P

  • Copying attribute values in xsl transformation

    Hi
    Does anyone know how to copy attribute values in a transfomation generated in a routing rule of a ESB routing service.
    When I inspect the generated xsl (after mapping elements), I can see that the xsl:value-of is used and therefore the element attributes of the original message are lost.
    Specifically when an element contains the xsi:nil attribute, I want to copy it to the target message.
    Suggestions would be greatly appreciated,
    Ruud

    Hi Nathalie,
    Thanks for your reply.
    I would like to elaborate a bit on our problem because I feel that we haven't reached a satisfactory solution yet.
    We are using ESB database adapters to perform DML operations on the database. However we expose these adapters using routing services to allow us to use filters, content based routing etc.
    Consider this example:
    I want to perform an update on a row in the database. If my soap call contains an empty element, this element will be ignored. If I want this the corresponding attribute in the database set to NULL then I have to add the xsi:nill="true" attribute to the element in my message. This works great when invoking the database adapter directly but when you place a routing service in front of it, the transformation will wipe out the xsi:nill="true" attribute on the element causing the database adapter to ignore the element instead of updating to NULL.
    We have found two workarounds:
    detectommissions="false" setting in the wsdl of the database adapter. All empty elements in the message will cause an update to NULL in the database. This means that for every update you always have to have all values in your message to prevent unwanted updates to NULL.
    Add a choose / when / otherwise construction in the transformation of the routing service. If the source element is empty we add an empty element in the destination message containing an xsi:nill="true" attribute, otherwise we just copy the value.
    This construction should be added for each attribute that must be updateable to null.
    Both of these solutions are not satisfactory because they eliminate the choice whether an empty element in the invoking soap call should be ignored or used to trigger an update to null.
    We would like to be able to detect the xsi:nill="attribute" on the invoking call and propagate this attribute to the call to the database adapter.
    Kind regards,
    Ruud

  • How can we enter value more than 99 crores in valuation price field in PR

    we want to fill value more than 99 crores in valuation price while making a purchase requisition in sap.
    we are not able to do that
    we are getting error
    entry too long (enter in the format ,,,~.)
    how can we configure to get more than 9 digits in a value field in sap
    is this the right forum to post this question
    Edited by: ca sanjeev mehndiratta on Jan 6, 2010 6:14 AM

    Hi,
    you can't enter more then 9 digits. This field is using a domain WERT11 which has format 9.2. You could try to modify SAP standard and add some additional digits for this field but this is very risky thing.
    Cheers

  • Sending more than one string from a server to a client in TCP/IP

    hi,
    i have two VIs where one is the server and the other the client in TCP/IP. I need to send more than 2 strings to the client at the same time.i have used the XML method but then by using XML i cant send any thing else to the client because of the byte sizes. so either i need a new way to send the strings or a new way to send more data. i have attached my VIs to this post if you need to take a look.
    thanks,
    Rambaldi.
    Attachments:
    ServerClient.zip ‏83 KB

    Well, after looking at the code it is very difficult to understand what you are trying to do. Not to be nasty or anything but your code is a mess. Did you know that in both VIs you have an infinite loop? The only way to exit your VIs is to use the Abort button. This is bad since it doesn't allow you to actually perform any type of cleanup. Your wiring is very difficult to follow. You should also avoid using local variables to pass data through your application. If you need to pass data between two parallel processes use queues, notifiers or an action engine. You can get rid of all of the sequence frames that you have. They aren't really doing anything for you and are unnecessary.
    As to your particular question I would have to assume that it is simply a result of bad coding that is preventing you from sending more than one string. You have logic in the second loop that appears to be impossible to get to since the conrol used to switch the case statement is placed on a hidden part of the front panel. Take a look at the TCP server example I posted in this thread. The example is on the second page of that thread.
    In order to help you I think you need to provide a good description of exactly what you want your server and client to do. You also need to do some code cleanup to make it readable and easier to follow.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How add attribute to more than one user.

    Hi.
    I have long list of user, but their have no defined attribute O, OU and mailhost. I can add this attribute singly for user only separately.
    I woundering that how add attributes for more user by the same time.
    And who know, why though I have user in separately OU and O, the user have no attribute in Generic Editor for example. I can not use function Search in Server Console, because any user have no this attributes.
    If anybody know any solution , please help me

    O, and OU are not attributes, therefore you cannot search for them on any object under such o, or ou. In order to add any atribute to a user, the best way is to extend the user, inetorguser, etc., by creating a new class that inherits from any of the classes already existing for users. Then, create any new attribute, and add it to the class....Then run a big ldif adding objectclass: newclass to al the users or only to the users you want. It is easier to do it than to explain it, believe me.
    Good Luck!
    Enrique.

  • Pass values other than string to applet

    Can you pass values other than strings via the <param> tag to an applet?

    I guess I didn't make my question clear enough. I know that you can pass integers and floats and what not because you can always call parsing functions. What i meant was can you pass java objects like Image objects, or session objects, things that cannot be parsed from strings

  • Shell script how getopts can accept more than one string in one var

    In shell script   how  getopts  can  accept  more than one string in one variable    DES
    Here is the part of shell script that accepts variables  from the Shell script  but the   DES   variable does not accepts more than one variable.,  how to do this ??
    When i run the script like below
    sh Ericsson_4G_nwid_configuration.sh   -n  orah4g    -d   "Ericsson 4g Child"    -z Europe/Stockholm
    it does not accepts    "Ericsson 4g Child"    in  DES  Variable   and only accepts    "Ericsson"  to DES variable.
    how to make it accept     full   "Ericsson 4g Child" 
    ========================================
    while getopts “hn:r:p:v:d:z:” OPTION
    do
      case $OPTION in
      h)
      usage
      exit 1
      n)
      TEST=$OPTARG
      z)
      ZONE="$OPTARG"
      d)
      DES="$OPTARG"
      v)
      VERBOSE=1
      usage
      exit
      esac
    done

    Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code
    Also, see http://mywiki.wooledge.org/Quotes

  • How to extract sub string value from a string?

    Hi,
    I need to know how can i extract sub strings from a main
    string, something like this:
    main variable-------->"2087-5E2SE-19-JG7BC"
    i want to split it into like this:
    sub_main_1 variable---------> "2087"
    sub_main_2 variable---------> "5E2SE"
    sub_main_2 variable---------> "19"
    sub_main_2 variable---------> "JG7BC"
    I did the same in flash by using Split and arrays, like this:
    var my_str:String = "2087-5E2SE-19-JG7BC";
    var my_array:Array = my_str.split("-");
    for (var i = 0; i<my_array.length; i++) {
    trace(my_array
    this.aaa1 = my_array[1];
    this.aaa2 = my_array[2];
    this.aaa3 = my_array[3];
    this.aaa4 = my_array[4];
    My question is that how can i do the same in director ?? i
    haven't find any split function in director.
    Thanks in advance,
    Amir

    You do a similar thing in Director using the itemDelimiter,
    which is a
    _player object property in MX2004. By default, it's a comma:
    put _player.itemDelimiter
    It will let you get specific items within a string.
    p = "2087-5E2SE-19-JG7BC"
    _player.itemDelimiter = "-"
    put p.item[1]
    -- "2087"
    You could use it to write yourself a little split function:
    on split(theString, theDelimiter)
    oldDelim = _player.itemDelimiter
    _player.itemDelimiter = theDelimiter
    itemList = []
    repeat with cnt = 1 to theString.item.count
    itemList.add(theString.item[cnt])
    end repeat
    return itemList
    end
    p = "2087-5E2SE-19-JG7BC"
    a = split(p, "-")
    put a
    -- ["2087", "5E2SE", "19", "JG7BC"]
    Dave -
    Adobe Community Expert
    www.blurredistinction.com
    http://www.adobe.com/communities/experts/

  • Numeric values longer than 32bit?

    Greetings,
    I'm an EE student currently working as a LV instrument driver developer
    for a well-known T&M equipment manufacturer here in Munich.
    My problem is the following: Is it possible to handle numeric values
    longer than 32bit in LV? Specifically, one of my instrument driver VIs
    needs to supply an initialization value to the Wideband CDMA "long code"
    configuration menu of a versatile vector signal generator. This value
    can range from 0x0 to 0x1FF,FFFF,FFFF (which accounts for 41 bits, if
    I'm not mistaken). The instrument expects this value in hexadecimal
    form.
    A quick and dirty solution could be either to split up the control range
    in 32+9 bits, i.e. place two controls on the front panel, or to use a
    string control an
    d have the user specify the hex value as a string. Both
    solutions are not very desirable though, especially since instrument
    driver VIs are meant to be used as sub-VIs in customer-specific programs
    and for that reason aren't usually accessed from their front panels.
    So, are there any other, more elegant solutions than the ones mentioned
    above?
    Thanks a lot in advance!
    (c) Tobias Hermann

    In <[email protected]> Tobias Hermann writes:
    >My problem is the following: Is it possible to handle numeric values
    >longer than 32bit in LV? Specifically, one of my instrument driver VIs
    >needs to supply an initialization value to the Wideband CDMA "long code"
    >configuration menu of a versatile vector signal generator. This value
    >can range from 0x0 to 0x1FF,FFFF,FFFF (which accounts for 41 bits, if
    >I'm not mistaken). The instrument expects this value in hexadecimal
    >form.
    FORMING THE 41-bit STORAGE
    You can create any arbitray numerical data length by using a binary
    array. This is the best and most direct solution to your needs.
    Just remember, LabView allocates binary arrays in multiples of bytes,
    so a 41-bit array will be rounded up to a length of 6 bytes or
    48-bits; however, LabView knows to return only the first 41-bits to
    you upon request.
    GENERATING AN ARRAY OF 41-bit VALUES
    The next issue is that you need an array of 41-bit numbers. You simply
    define this as a 2-dimensional array of binary values. When
    initializing this array, be certain you order the dimension indices
    such that the fastest moving index has a size value of 41. The slowest
    moving index will then be for the actual numerical size of your array.
    If you transpose the index definition, nothing will work right! Be
    careful!
    When your array (above) is defined, it should be shown in LabView as a
    brown wire, which deplicts it as a binary 2-dimensional array. If it
    is instead shown in a magenta color, then you instead defined and array
    (cluster) of 41-bit binary numbers. That will work okay too (and will
    even be easier the used), but it will take more storage and will take
    LabView longer to handle. However, if you're more confortable will the
    latter choice, I can understand that. It does have the feature of being
    able to address each 41-bits number directly. With the 2-dim approach
    I initially outlined, you'll need to slice out each 41-bit number from
    the 2-dim array each time you access (read/write) it.
    FORMATTING BINARY INTO HEX
    Formatting your storged numbers is an entirely _separate_ issue and
    your 41-bits numbers only need to worry about formatting when you
    send them to an output device. For a LabView control panel, simply
    open a binary array control, then select the appropriate options so
    they are displayed in base-2, octal, or hex. LabView supports all
    three display formats with any binary indicator.
    If you need to format your numbers to a hex string (for an output
    device), try the "To Hexadecimal" or "Format & Append" function.
    Again, if you're using the 2-dim binary array apprach, you'll need to
    slice out each 41-bit number indivdually. If you're using the cluster
    (array) if 1-dim 41-bit array approach, you can skip that step.
    Frankly, I'm not sure how well LabView's formatting functions work with
    1-dim binary arrays, but in principal they should. If they don't work
    directly, no big deal. Just cast the 41-bit arrays into U8 numbers
    (bytes) and have the formatting function format those numbers into hex
    strings; simply one more step.
    One question: Why on earth do you want to format the data going
    into your instrument in the first place? Almost all instruments will
    take binary input _directly_ without formatting it into ASCII (octal,
    hex, etc) first. This is much faster because the ASCII of all this
    hex stuff requires many more bytes to transfer to your instrument.
    Moreover, the instrument then needs to convert the ASCII (hex) back
    into binary before it can use any of it. You should investigate
    skipping the formatting step altogether. The exception might be
    if you're using an RS-232 connection to your instrument where raw
    binary isn't allowed. Newer interfaces like GPIB, 1394, etc will
    allow binary transfer directly.
    COMMENTS ON STRINGS
    Don't use strings in LabView. By default, each string get a minimal
    memory allocation of 2K. If you define a 100 element (array) string,
    that's 200K of memory just to hold those strings. Not a big deal, but
    when the memory manager starts doing garbage collection (which is
    required with string manipulations), things will really slow down.
    String are important, but data should always be stored in a binary
    form within any computer, not in ASCII formatted form (hex included).
    /\ Mark M Mehl, alias Superticker (Supertickler to some)
    <><> Internet: [email protected]
    \/ Preferred UUCP: uunet!iastate.edu!mehl
    Disclaimer: You got to be kidding; who would want to claim anything I said?

Maybe you are looking for

  • Safari 4.0.4 update creates 7510 new permissions problems

    Prior to installing Safari update, running the 'Repair Permissions' in Disk Utility found only one error -- the SUID modification on ARDAgent (Apple Remote Desktop Agent). Apple documents this as being a known issue, but harmless and can be safely ig

  • Incopy Crashes when placin docx

    Is anyone having trouble placing docx files in Incopy files linked to an Indesign file? I keep crashing.

  • Redo log backup failing

    Hi everyone, When I'm scheduling Archive log backup through DB13 the backup are failing. Here is the logfile of the failed Redo log backup file. 2008-09-03 14:45:05 Job started 2008-09-03 14:45:05 Step 001 started (program RSDBAJOB, variant &00000000

  • Rollover Overlays

    Having trouble creating rollover overlays on my menu driven project in button menu of FCP. I have a total of seven menu connections and only two worked? Is it something simple that I am overlooking?

  • Aperture Projects - Hidden Photos - Corrupt?

    I have about 10 folders, perhaps 500 subfolders, and about 1300 projects in a 40 GB Aperture 3 Library.  One folder, and many, but not all, of the perhaps 300 subfolders 400 projects inside, will not show photos.  The photo count in the projects are