SlideShare a Scribd company logo
Working with XSLT, XPATH and ECMAScript
in Novell Identity Manager Policies
                 ®



Made Simpler with Designer



David Wagstaff
Consulting Custom Development
Novell


Vivek Thakyal
IDM Software Engineer
Novell
Outline

    •   Overview w/Comparison Demonstrations

    •   ECMAScript w/Demonstration

    •   Common Traps to Avoid

    •   Questions/More Demonstrations




2   © Novell, Inc. All rights reserved.
Overview w/Comparison Demonstrations
Identity Manager Foundation

    event-driven object synchronization though marshalling
    to xml, xml transformations, and unmarshalling


    Whenever the Identity Vault (or a driver) detects an
    event like add User, it describes the event in an xml
    document that starts in the subscriber channel (or
    publisher channel). The xml document goes through a
    series of transformations before arriving at the end of the
    subscriber channel (or publisher channel) to add User
    on the other end.



4   © Novell, Inc. All rights reserved.
Transformations

    •   Policy (DirXMLScript)

    •   Stylesheet (XSLT)



    Identity Manager engine understands both. You can mix
    them within a policy set.



    How to choose?


5   © Novell, Inc. All rights reserved.
Extensions

    •   Java

    •   ECMAScript (Javascript via Rhino)

    •   JVM languages like Groovy



    How to choose?




6   © Novell, Inc. All rights reserved.
Common Tools

    •   Regular Expressions (regEx)

    •   XPath



    How to choose?




7   © Novell, Inc. All rights reserved.
Simple Demonstrations
    for Comparison
    The department name on a user in Identity Vault should
    start with an 'e', but on Active Directory should start with
    a 'j', e.g. enc127 vs jnc127
    •   policy without regEx
    •   policy with regEx
    •   policy extended with Java
    •   policy extended with ECMAScript
    •   stylesheet


    Hint: Where is more important than how.

8   © Novell, Inc. All rights reserved.
Quiz

    The department attribute is called Department Code in
    the Identity Vault and dept in the connected system.
    Which of the following would be good choice(s) to
    change the attribute name?
    •   XPath
    •   Regular Expressions
    •   Java
    •   ECMAScript
    •   Policy
    •   Stylesheet
9   © Novell, Inc. All rights reserved.
ECMAScript w/Demonstration
ECMAScript

     •   A standardized version of Javascript

     •   Java like syntax

     •   Dynamically typed

     •   Very good String library

     •   Good Math library

     •   Works great with regular expressions



11   © Novell, Inc. All rights reserved.
Strings in ECMAScript

     •   String Literal “text” or 'text'
          –   use either single or double quotes
     •   Important functions:
          –   substr (startIndex, numberOfChars)
          –   substring (startIndex, endIndex)
          –   charAt (indexOfChar)
          –   indexOf (charSequence)
          –   replace (regExp, replacement)
          –   match (regExp) : returns an array of matches
          –   search (regExp) : returns the index of the first match
          –   split (separator, limit) : returns an array of split up strings

12   © Novell, Inc. All rights reserved.
Regular Expressions in ECMAScript

     •   Regular expression literal in ECMAScript
         /[pattern]/[modifiers] e.g. /[a-z]+/gi
     •   Modifiers:
          –   g (Global)
          –   i (Case Insensitive)
          –   m (Multi-line)
     •   Important Functions:
          –   test (string) : returns true or false
          –   exec (string) : returns an array of matches
          –   compile (regExp, modifier) : compiles a regular expression
              object

13   © Novell, Inc. All rights reserved.
ECMAScript Demonstration

     •   Changing the Telephone Number format from
          –   (xxx) xxx-xxxx to a pure integer xxxxxxxxxx

          –   Pure integer xxxxxxxxxx to (xxx) xxx-xxxx

     •   Setting the correct area code (the first three digits)
         in a Telephone Number from a lookup table




14   © Novell, Inc. All rights reserved.
Common Traps to Avoid
Java Traps

     •   Namespace

     •   Constructor

     •   Instance Method

     •   Static Method



     •   Hint: Static method is easiest and less error prone.



16   © Novell, Inc. All rights reserved.
XPath Traps

     •   policy using absolute path

     •   // getting too much

     •   assuming order

     •   multiple attribute values

     •   string of XML




17   © Novell, Inc. All rights reserved.
XSLT Traps

     •   bad XPath, see XPath Traps

     •   doing it in text editor

     •   not using a variety of sample inputs

     •   forgetting <apply-templates ...>




18   © Novell, Inc. All rights reserved.
Regular Expression Traps

     •   globbing

     •   not escaping meta-characters

     •   groups within groups

     •   using non-Java dialects

     •   doing it in text editor




19   © Novell, Inc. All rights reserved.
ECMAScript Traps

     •   Plus operator overloading

     •   Semicolon insertion at line feed

     •   String replace only replaces first occurrence – use
         the /text/g global modifier

     •   ParseInt function – use parseInt(num, 10) instead of
         parseInt(num) to be safe




20   © Novell, Inc. All rights reserved.
Questions/More Demonstrations
Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identity Manager Designer
Unpublished Work of Novell, Inc. All Rights Reserved.
This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc.
Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope
of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified,
translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc.
Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.


General Disclaimer
This document is not to be construed as a promise by any participating company to develop, deliver, or market a
product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in
making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents
of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any
particular purpose. The development, release, and timing of features or functionality described for Novell products
remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to
make changes to its content, at any time, without obligation to notify any person or entity of such revisions or
changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc.
in the United States and other countries. All third-party trademarks are the property of their respective owners.

More Related Content

PDF
Introduction to Crystal and Jasper Reports for Novell Sentinel 6.1
PDF
Novell Identity Manager Tips, Tricks and Best Practices
PDF
Novell iPrint: Advanced Features on Linux
PDF
Percona presentation v2
PDF
Lessons Learned: Novell Open Enterprise Server Upgrades Made Easy
PDF
Integrating Novell Teaming within Your Existing Infrastructure
PDF
Finding Virtual Coins in the Couch
PDF
Accelerating Server Hardware Upgrades with PlateSpin Migrate P2P
Introduction to Crystal and Jasper Reports for Novell Sentinel 6.1
Novell Identity Manager Tips, Tricks and Best Practices
Novell iPrint: Advanced Features on Linux
Percona presentation v2
Lessons Learned: Novell Open Enterprise Server Upgrades Made Easy
Integrating Novell Teaming within Your Existing Infrastructure
Finding Virtual Coins in the Couch
Accelerating Server Hardware Upgrades with PlateSpin Migrate P2P

What's hot (20)

PDF
Migrating P2V: SUSE Linux Enterprise Server with Xen
PDF
My sql 5.6_replwebinar_may12
PDF
Conference tutorial: MySQL Cluster as NoSQL
PDF
Virtualizing Mission-critical Workloads: The PlateSpin Story
PPTX
Whd master deck_final
PPTX
Siebel Server Cloning available in 8.1.1.9 / 8.2.2.2
PDF
Securing Your Endpoints Using Novell ZENworks Endpoint Security Management
PDF
Status Quo on the automation support in SOA Suite OGhTech17
PPTX
50 migrations in 24 hours
PPTX
Virtualization and Containers
PDF
Dell PowerEdge Zero Touch Provisioning
PDF
Integrating Apple Macs Using Novell Technologies
PPTX
The Very Very Latest in Database Development - Oracle Open World 2012
PPTX
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
PPTX
Hazelcast For Beginners (Paris JUG-1)
PPTX
Copy Data Management for the DBA
PDF
Hazelcast for Terracotta Users
PPT
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
PDF
Simplifying systems management with Dell OpenManage on 13G Dell PowerEdge ser...
Migrating P2V: SUSE Linux Enterprise Server with Xen
My sql 5.6_replwebinar_may12
Conference tutorial: MySQL Cluster as NoSQL
Virtualizing Mission-critical Workloads: The PlateSpin Story
Whd master deck_final
Siebel Server Cloning available in 8.1.1.9 / 8.2.2.2
Securing Your Endpoints Using Novell ZENworks Endpoint Security Management
Status Quo on the automation support in SOA Suite OGhTech17
50 migrations in 24 hours
Virtualization and Containers
Dell PowerEdge Zero Touch Provisioning
Integrating Apple Macs Using Novell Technologies
The Very Very Latest in Database Development - Oracle Open World 2012
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Hazelcast For Beginners (Paris JUG-1)
Copy Data Management for the DBA
Hazelcast for Terracotta Users
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
Simplifying systems management with Dell OpenManage on 13G Dell PowerEdge ser...
Ad

Similar to Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identity Manager Designer (20)

PDF
Impact 2014 - IIB - selecting the right transformation option
PPTX
Soap UI - Lesson45
PPTX
Introduction to SoapUI day 4-5
PPTX
Tibco business works
PPTX
Integreation
PDF
Adobe action script 3.0 programming
PDF
Inventing the future Business Programming Language
PPT
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
PPTX
JS - Basics
PDF
Adobe action script 3.0 programming
KEY
Beyond TDD: Enabling Your Team to Continuously Deliver Software
KEY
Eclipse @eBay 2009
PDF
Learning Xslt A Handson Introduction To Xslt And Xpath 1st Edition Michael Ja...
PDF
Eclipse Rich Client Platform 2nd Edition Jeff Mcaffer
PPTX
IT for HR professionals
PDF
Custom Development with Novell Teaming
PDF
Custom Development with Novell Teaming
PDF
Custom Development with Novell Teaming
PDF
Custom Development with Novell Teaming
PDF
XML usage in my work, 2015
Impact 2014 - IIB - selecting the right transformation option
Soap UI - Lesson45
Introduction to SoapUI day 4-5
Tibco business works
Integreation
Adobe action script 3.0 programming
Inventing the future Business Programming Language
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
JS - Basics
Adobe action script 3.0 programming
Beyond TDD: Enabling Your Team to Continuously Deliver Software
Eclipse @eBay 2009
Learning Xslt A Handson Introduction To Xslt And Xpath 1st Edition Michael Ja...
Eclipse Rich Client Platform 2nd Edition Jeff Mcaffer
IT for HR professionals
Custom Development with Novell Teaming
Custom Development with Novell Teaming
Custom Development with Novell Teaming
Custom Development with Novell Teaming
XML usage in my work, 2015
Ad

More from Novell (20)

PDF
Filr white paper
PDF
Social media class 4 v2
PDF
Social media class 3
PDF
Social media class 2
PDF
Social media class 1
PDF
Social media class 2 v2
PDF
LinkedIn training presentation
PDF
Twitter training presentation
PDF
Getting started with social media
PDF
Strategies for sharing and commenting in social media
PPT
Information Security & Compliance in Healthcare: Beyond HIPAA and HITECH
PPT
Workload iq final
PDF
The Identity-infused Enterprise
PDF
Shining the Enterprise Light on Shades of Social
PDF
Accelerate to the Cloud
PDF
The New Business Value of Today’s Collaboration Trends
PDF
Preventing The Next Data Breach Through Log Management
PDF
Iaas for a demanding business
PDF
Workload IQ: A Differentiated Approach
PDF
Virtual Appliances: Simplifying Application Deployment and Accelerating Your ...
Filr white paper
Social media class 4 v2
Social media class 3
Social media class 2
Social media class 1
Social media class 2 v2
LinkedIn training presentation
Twitter training presentation
Getting started with social media
Strategies for sharing and commenting in social media
Information Security & Compliance in Healthcare: Beyond HIPAA and HITECH
Workload iq final
The Identity-infused Enterprise
Shining the Enterprise Light on Shades of Social
Accelerate to the Cloud
The New Business Value of Today’s Collaboration Trends
Preventing The Next Data Breach Through Log Management
Iaas for a demanding business
Workload IQ: A Differentiated Approach
Virtual Appliances: Simplifying Application Deployment and Accelerating Your ...

Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identity Manager Designer

  • 1. Working with XSLT, XPATH and ECMAScript in Novell Identity Manager Policies ® Made Simpler with Designer David Wagstaff Consulting Custom Development Novell Vivek Thakyal IDM Software Engineer Novell
  • 2. Outline • Overview w/Comparison Demonstrations • ECMAScript w/Demonstration • Common Traps to Avoid • Questions/More Demonstrations 2 © Novell, Inc. All rights reserved.
  • 4. Identity Manager Foundation event-driven object synchronization though marshalling to xml, xml transformations, and unmarshalling Whenever the Identity Vault (or a driver) detects an event like add User, it describes the event in an xml document that starts in the subscriber channel (or publisher channel). The xml document goes through a series of transformations before arriving at the end of the subscriber channel (or publisher channel) to add User on the other end. 4 © Novell, Inc. All rights reserved.
  • 5. Transformations • Policy (DirXMLScript) • Stylesheet (XSLT) Identity Manager engine understands both. You can mix them within a policy set. How to choose? 5 © Novell, Inc. All rights reserved.
  • 6. Extensions • Java • ECMAScript (Javascript via Rhino) • JVM languages like Groovy How to choose? 6 © Novell, Inc. All rights reserved.
  • 7. Common Tools • Regular Expressions (regEx) • XPath How to choose? 7 © Novell, Inc. All rights reserved.
  • 8. Simple Demonstrations for Comparison The department name on a user in Identity Vault should start with an 'e', but on Active Directory should start with a 'j', e.g. enc127 vs jnc127 • policy without regEx • policy with regEx • policy extended with Java • policy extended with ECMAScript • stylesheet Hint: Where is more important than how. 8 © Novell, Inc. All rights reserved.
  • 9. Quiz The department attribute is called Department Code in the Identity Vault and dept in the connected system. Which of the following would be good choice(s) to change the attribute name? • XPath • Regular Expressions • Java • ECMAScript • Policy • Stylesheet 9 © Novell, Inc. All rights reserved.
  • 11. ECMAScript • A standardized version of Javascript • Java like syntax • Dynamically typed • Very good String library • Good Math library • Works great with regular expressions 11 © Novell, Inc. All rights reserved.
  • 12. Strings in ECMAScript • String Literal “text” or 'text' – use either single or double quotes • Important functions: – substr (startIndex, numberOfChars) – substring (startIndex, endIndex) – charAt (indexOfChar) – indexOf (charSequence) – replace (regExp, replacement) – match (regExp) : returns an array of matches – search (regExp) : returns the index of the first match – split (separator, limit) : returns an array of split up strings 12 © Novell, Inc. All rights reserved.
  • 13. Regular Expressions in ECMAScript • Regular expression literal in ECMAScript /[pattern]/[modifiers] e.g. /[a-z]+/gi • Modifiers: – g (Global) – i (Case Insensitive) – m (Multi-line) • Important Functions: – test (string) : returns true or false – exec (string) : returns an array of matches – compile (regExp, modifier) : compiles a regular expression object 13 © Novell, Inc. All rights reserved.
  • 14. ECMAScript Demonstration • Changing the Telephone Number format from – (xxx) xxx-xxxx to a pure integer xxxxxxxxxx – Pure integer xxxxxxxxxx to (xxx) xxx-xxxx • Setting the correct area code (the first three digits) in a Telephone Number from a lookup table 14 © Novell, Inc. All rights reserved.
  • 16. Java Traps • Namespace • Constructor • Instance Method • Static Method • Hint: Static method is easiest and less error prone. 16 © Novell, Inc. All rights reserved.
  • 17. XPath Traps • policy using absolute path • // getting too much • assuming order • multiple attribute values • string of XML 17 © Novell, Inc. All rights reserved.
  • 18. XSLT Traps • bad XPath, see XPath Traps • doing it in text editor • not using a variety of sample inputs • forgetting <apply-templates ...> 18 © Novell, Inc. All rights reserved.
  • 19. Regular Expression Traps • globbing • not escaping meta-characters • groups within groups • using non-Java dialects • doing it in text editor 19 © Novell, Inc. All rights reserved.
  • 20. ECMAScript Traps • Plus operator overloading • Semicolon insertion at line feed • String replace only replaces first occurrence – use the /text/g global modifier • ParseInt function – use parseInt(num, 10) instead of parseInt(num) to be safe 20 © Novell, Inc. All rights reserved.
  • 23. Unpublished Work of Novell, Inc. All Rights Reserved. This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability. General Disclaimer This document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for Novell products remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.