40020

673
-1

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
673
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

40020

  1. 1. © 2008 Oracle Corporation – Proprietary and Confidential
  2. 2. <Insert Picture Here> PeopleTools Advanced Tips and Techniques Jim Marion Senior Applications Technology Consultant, ADS
  3. 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. © 2008 Oracle Corporation – Proprietary and Confidential
  4. 4. Program Agenda Example • Communities and resources <Insert Picture Here> • PeopleTools – the extensible foundation • Extend the app server • Extend the web server • Extend Integration Broker • Extend the user interface – IScripts – Ajax © 2008 Oracle Corporation – Proprietary and Confidential
  5. 5. <Insert Picture Here> Communities and Resources © 2008 Oracle Corporation – Proprietary and Confidential
  6. 6. mix.oracle.com • Groups – PeopleTools – PeopleSoft – Enterprise Portal – Application specific groups • Mingle with peers • Solicit votes for ideas • See what other customers are asking, doing, and want to do • Post your own tips and techniques • Answer your peers questions © 2008 Oracle Corporation – Proprietary and Confidential
  7. 7. Blogs • http://jjmpsj.blogspot.com/ • http://blog.greysparling.com/ • IT Toolbox groups ERP > PeopleSoft • http://blogs.ittoolbox.com/peoplesoft/rob • http://xtrahot.chili-mango.net/ • http://peoplesofttipster.com/ • http://campus-codemonkeys.blogspot.com/ • http://blogs.oracle.com/peopletools/ © 2008 Oracle Corporation – Proprietary and Confidential
  8. 8. <Insert Picture Here> PeopleTools Foundation © 2008 Oracle Corporation – Proprietary and Confidential
  9. 9. The Extensible Foundation The “Tech Stack” • Relational database – Programmable • Functions, procedures, triggers • App Server – Java VM – Native libraries • J2EE web server – JSP/JSF – Servlets – EJB • Web Browser © 2008 Oracle Corporation – Proprietary and Confidential
  10. 10. <Insert Picture Here> Extend the App Server © 2008 Oracle Corporation – Proprietary and Confidential
  11. 11. Extend the PeopleCode Language • Operating system native libraries – dll’s – so’s • Java VM – Standard Java API – Custom Java classes © 2008 Oracle Corporation – Proprietary and Confidential
  12. 12. Extend the PeopleCode Language Why? • Some things are easier to do in Java – Java regular expressions versus PeopleCode String manipulation • Take advantage of existing libraries – Apache POI for reading binary Microsoft Excel files (integration) © 2008 Oracle Corporation – Proprietary and Confidential
  13. 13. Extend PeopleCode Language Using the Java API Function ResolveMetaHTML(&html as string) returns string Local JavaObject &pattern; Local JavaObject &matcher; Local String &node_url; REM ** Resolve %NodePortalURL(NODENAME) tags; &pattern = GetJavaClass("java.util.regex.Pattern") .compile("(?i)%NodePortalURL((w+))"); &matcher = &pattern.matcher( CreateJavaObject("java.lang.String", &html)); While &matcher.find() SQLExec("SELECT URI_TEXT FROM PSNODEURITEXT WHERE MSGNODENAME = :1 AND URI_TYPE = 'PL'", &matcher.group(1), &node_url); &html = Substitute(&html, &matcher.group(), &node_url); End-While; End-Function; © 2008 Oracle Corporation – Proprietary and Confidential
  14. 14. Extend PeopleCode Language Custom Java Classes REM ** Generate MD5 checksum; Function test_md5() Returns string Local JavaObject &jMD5; &jMD5 = GetJavaClass("com.oracle.ads.peoplesoft.MD5"); &sig = &jMD5.encodeString("String to encode"); End-Function; © 2008 Oracle Corporation – Proprietary and Confidential
  15. 15. Access PeopleSoft from Java • Within a PeopleSoft session (app or process scheduler server) – PeopleCode objects • Record, SQL, Field, File, XMLDoc, etc – PeopleCode functions • Func.SQLExec, Func.SendMail, etc – PeopleCode system variables • Sysvar.UserId(), Sysvar.Roles() – TIP: Add peoplecode.jar to your Java IDE’s classpath © 2008 Oracle Corporation – Proprietary and Confidential
  16. 16. Java Integration Scenario • Vendor e-mails invoice in Microsoft Excel format • You need to create a voucher from that invoice • Solution – Use Apache POI (http://poi.apache.org/) and PeopleCode objects/functions to copy spreadsheet to staging table (Java) – Use a component interface based on VCHR_EXPRESS to create vouchers (PeopleCode) © 2008 Oracle Corporation – Proprietary and Confidential
  17. 17. Java Integration Scenario Java Component public static void processSpreadsheet(int processInstance) { //POI variable initilization, etc ... // 20 insert bind values Object[] parms = new Object[20]; parms[0] = row.getCell(0).getStringCellValue(); // column 2 contains an integer Parms[1] = new Integer(row.getCell(1).getNumericCellValue().intValue()); ... // use Meta-SQL to simplify retrieving SQL from // stored SQL object Func.SQLExec("%SQL(MYSQLOBJECT)", parms); ... } © 2008 Oracle Corporation – Proprietary and Confidential
  18. 18. Advantages of using PeopleCode Data Objects from Java • Avoid JDBC configuration, data access, authentication, etc • Simplicity of SQLExec • Simplicity of SQL objects/cursors • Meta-SQL expansion • Avoid updating PS database directly © 2008 Oracle Corporation – Proprietary and Confidential
  19. 19. Access PeopleSoft from Java Aditional References • Enterprise PeopleTools 8.49 PeopleBook: PeopleCode API Reference > Java Class • http://tinyurl.com/2vzv9w (links to my blog) © 2008 Oracle Corporation – Proprietary and Confidential
  20. 20. <Insert Picture Here> Extend the Web Server © 2008 Oracle Corporation – Proprietary and Confidential
  21. 21. Extensible Options • Standard J2EE web server options – Servlet filters – JSP – JSF – Custom Servlets – CGI © 2008 Oracle Corporation – Proprietary and Confidential
  22. 22. Standard Request Response Cycle... … and then ServletFilters Web Server App Server Request est Requ Client/Browser Response se pon Res Web Server Modify Request ServletFilter Servlet Request Response Modify Response © 2008 Oracle Corporation – Proprietary and Confidential
  23. 23. ServletFilters • Allow you to modify the HTTP request or response • Examples – Authentication – Injection • Monkeygrease – Add additional HTML/JavaScript/CSS to pages – Compression – URLRewriting – Encryption – Encoding – Request/Response header modification © 2008 Oracle Corporation – Proprietary and Confidential
  24. 24. Monkeygrease Examples ServletFilter • Highlight the active field – http://jjmpsj.blogspot.com/2006/09/where-am-i.html • Keyboard navigation – http://tinyurl.com/yrwsap (links to Grey Sparling blog) • Override CSS without customizing PeopleSoft stylesheets © 2008 Oracle Corporation – Proprietary and Confidential
  25. 25. Authentication Examples ServletFilter • Use jCIFS to pass Windows authentication token to web server using NTLM – http://tinyurl.com/yuk8bl (links to my blog) © 2008 Oracle Corporation – Proprietary and Confidential
  26. 26. <Insert Picture Here> Extend Integration Broker © 2008 Oracle Corporation – Proprietary and Confidential
  27. 27. Integration Broker SDK Custom Connectors • Create connectors to send Integration Broker messages to targets not covered by delivered connectors – Databases via JDBC (JDBCTargetConnector) – Other TCP/IP based protocols – Anywhere, in any electronic way • JavaTargetConnector • ScriptTargetConnector © 2008 Oracle Corporation – Proprietary and Confidential
  28. 28. Vendor Batch Integration Scenario • Open cursor on vendor table • For each row, select row from target – If exist, compare values • If changed, update – If not exist, insert • How often do you run this? – Too often for the system to handle (resource intensive) – Not often enough for the user © 2008 Oracle Corporation – Proprietary and Confidential
  29. 29. JavaTargetConnector Prototype package com.peoplesoft.pt.integrationgateway.targetconnector; import ...; public class JavaTargetConnector implements TargetConnector { // respond to "pings" public IBResponse ping(IBRequest request) throws ... { ... } // send the message public IBResponse send(IBRequest request) throws ... { // look up Java class handler from config and use reflection // to call registered Java class } // provide connector setup info for gateway and node setup public ConnectorDataCollection introspectConnector() { ... } } © 2008 Oracle Corporation – Proprietary and Confidential
  30. 30. Custom Connector Advantages • Real time integration • Reuse PeopleSoft delivered integration points • Changes are published at save time, you don’t need complex logic to find them. © 2008 Oracle Corporation – Proprietary and Confidential
  31. 31. Custom Connectors Custom Connectors Documentation and Examples • SDK location: web server’s /PSIGW/SDK directory • Java IDE configuration tips – See /PSIGW/SDK/docs/SDK/ReadMe.txt • Contains tips on configuring your classpath – Most important, add /PSIGW/WEB-INF/classes to your classpath © 2008 Oracle Corporation – Proprietary and Confidential
  32. 32. <Insert Picture Here> IScripts – The Swiss Army Knife © 2008 Oracle Corporation – Proprietary and Confidential
  33. 33. What is an IScript? • A function that can be called from a URL • http:…/EMPLOYEE/EMPL/s/WEBLIB_ADS_FB.ISCRIPT1 .FieldFormula.IScript_GetFriends • Takes no parameters and does not return a value Function IScript_GetFriends() ... End-Function; • Contained in a record named WEBLIB_XXXXXXXX • Provides access to %Request and %Response © 2008 Oracle Corporation – Proprietary and Confidential
  34. 34. What can they Do? • Custom user interfaces – Not bound to Page/Component paradigm • Ajax/Flex/Applet request/response handlers – Serve JSON, XML, or HTML in response to Ajax requests • Excellent for testing PeopleCode snippets • Just about anything… but choose wisely (see disadvantages) © 2008 Oracle Corporation – Proprietary and Confidential
  35. 35. IScript Examples • Bookmarklets – Turn on session tracing – Switch the language – Switch users – Get component CREF name – Lookup component search record • Data source for a Flex grid • Data source for an extjs Ajax grid (http://extjs.com/) © 2008 Oracle Corporation – Proprietary and Confidential
  36. 36. Get Component Search Record IScript Example • IScript to query database • JavaScript Bookmarklet to gather parameters © 2008 Oracle Corporation – Proprietary and Confidential
  37. 37. The IScript (Declare function and variables) Function IScript_GetSearchRecname() Local string &menu = %Request.GetParameter("m"); Local string &component = %Request.GetParameter("c"); Local string &market = %Request.GetParameter("mk"); Local string &recname; Local string &barname; Local boolean &override = True; REM continued on next slide; © 2008 Oracle Corporation – Proprietary and Confidential
  38. 38. The IScript (Continued – Query the Database) REM continued from previous slide; REM ** select search record name override from menu defn; SQLExec("SELECT SEARCHRECNAME, BARNAME FROM PSMENUITEM WHERE MENUNAME = :1 AND PNLGRPNAME = :2 AND MARKET = :3", &menu, &component, &market, &recname, &barname); If (None(&recname)) Then &override = False; REM ** select search record name from component; SQLExec("SELECT SEARCHRECNAME FROM PSPNLGRPDEFN WHERE PNLGRPNAME = :1 AND MARKET = :2", &component, &market, &recname); End-If; REM continued on next slide; © 2008 Oracle Corporation – Proprietary and Confidential
  39. 39. The IScript (Continued – Write the response) REM continued from previous slide; %Response.SetHeader("Content-Type", "text/plain"); %Response.Write("The search record is " | &recname); If (&override) Then %Response.Write(" and is overridden on menu " | &menu | " in bar " | &barname); End-If; %Response.Write("."); End-Function; © 2008 Oracle Corporation – Proprietary and Confidential
  40. 40. The Bookmarklet javascript: (function(){ var v1 = frames['TargetContent'].strCurrUrl; // parse the menu, component, market var v2 = v1.match( //c/([w_]+?).([w_]+?).([w_]+?)b/); // parse the url components var v3 = v1.match( /^(https?://)(.+?/).+?/(.+?/)(.+?/)(.+?/)/); // open the new results window window.open(v3[1] + v3[2] + 'psc/' + v3[3] + v3[4] + v3[5] + 's/WEBLIB_ADS_UTIL.ISCRIPT1.FieldFormula.IScript_GetSearchRecname?m= ' + v2[1] + '&c=' + v2[2] + '&mk=' + v2[3], 'results', 'width=400,height=100'); })(); © 2008 Oracle Corporation – Proprietary and Confidential
  41. 41. The Bookmarklet Compressed javascript:(function(){var v1=frames['TargetContent'].strCurrUrl;var v2=v1.match(//c/([w_]+?).([w_]+?).([w_]+?)b/);var v3=v1.match(/^(https?://)(.+?/).+?/(.+?/)(.+?/)(.+?/)/);wind ow.open(v3[1]+v3[2]+'psc/'+v3[3]+v3[4]+v3[5]+'s/WEBLIB_ADS_UTIL.ISC RIPT1.FieldFormula.IScript_GetSearchRecname?m='+v2[1]+'&c='+v2[2]+' &mk='+v2[3],'results', 'width=400,height=100');})() © 2008 Oracle Corporation – Proprietary and Confidential
  42. 42. Advantages of IScripts • Unstructured Request/Response handling – PeopleCode version of JSP/ASP – Very few rules • Full PeopleCode/Database access • Leverage PeopleSoft security model • Great for non-UI development © 2008 Oracle Corporation – Proprietary and Confidential
  43. 43. Disadvantages of IScripts • No META-DATA • No upgrade • No component processor – Event processing • More difficult to develop and maintain © 2008 Oracle Corporation – Proprietary and Confidential
  44. 44. <Insert Picture Here> Ajax © 2008 Oracle Corporation – Proprietary and Confidential
  45. 45. Keep the User Logged In Ajax Replacement for Timeout Warning • Relevant JavaScript variables timeOutURL warningTimeoutMilliseconds timeoutWarningID • Clear the existing timeout and timeout warning window.clearTimeout(timeoutWarningID); window.clearTimeout(timeoutID); • Ajax request to reset timeout at warning timeout interval // Ajax URL that will reset the timeout on the server timeOutURL.replace(/expire$/, "resettimeout"); • Set timeout interval low (5 min) and warning interval low (4 min) © 2008 Oracle Corporation – Proprietary and Confidential
  46. 46. Keep the User Logged In The JavaScript Globals /* clear old timeout after 30 seconds * macs don't set timeout until 1000 ms */ window.setTimeout('ads_setupTimeout()', 30000); var ads_timeoutIntervalId; var ads_resetUrl = null; © 2008 Oracle Corporation – Proprietary and Confidential
  47. 47. Keep the User Logged In The Setup Function function ads_setupTimeout() { /* some pages don't have timeouts defined */ if(typeof(timeOutURL) != "undefined") { if(timeOutURL.length > 0) { ads_resetUrl = timeOutURL.replace(/expire$/, "resettimeout"); if(totalTimeoutMilliseconds != null) { window.clearTimeout(timeoutWarningID); window.clearTimeout(timeoutID); ads_timeoutIntervalId = window.setInterval('ads_resetTimeout()', warningTimeoutMilliseconds); } } } } © 2008 Oracle Corporation – Proprietary and Confidential
  48. 48. Keep the User Logged In Injection Methods • Modify the header HTML object – PeopleTools Header: PORTAL_UNI_HEADER_NNS (potential upgrade issue) – Enterprise Portal Header: • PAPPBR_HTMLHDR4_TOOLS • Custom HTML object • Monkeygrease (http://monkeygrease.org) – Servlet filter that allows you to inject HTML into the PeopleSoft response © 2008 Oracle Corporation – Proprietary and Confidential
  49. 49. Pagelet Ajax Example Facebook (Social Networking) • Putting it all together – Java API, Ajax UI, IScripts © 2008 Oracle Corporation – Proprietary and Confidential
  50. 50. References • Bookmarklets – http://www.subsimple.com/bookmarklets/default.asp • Excellent tutorial, rules, and builder – http://www.bookmarklets.com/ • Ajax – http://jquery.org – http://monkeygrease.org • Blogs with PeopleTools Tips – http://jjmpsj.blogspot.com (My blog) – http://blog.greysparling.com/ – http://blogs.oracle.com/peopletools/ © 2008 Oracle Corporation – Proprietary and Confidential
  51. 51. © 2008 Oracle Corporation – Proprietary and Confidential
  52. 52. The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. © 2008 Oracle Corporation – Proprietary and Confidential
  53. 53. © 2008 Oracle Corporation – Proprietary and Confidential
  54. 54. © 2008 Oracle Corporation – Proprietary and Confidential
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×