Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Transformations - a TLCC & Teamstudio Webinar

1.069 Aufrufe

Veröffentlicht am

These are my slides I used during the webinar hosted by TLCC & Teamstudio on April 21, 2015.
It's the session I held at Engage.UG March 31, 2015 and at ICS.UG March 26, 2015

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Transformations - a TLCC & Teamstudio Webinar

  1. 1. Transformations Smart Application Migration A presentation of Oliver Busse @ Engage.UG in March 2015 Broadcasted in the TLCC & Teamstudio Webinar April 21, 2015
  2. 2. Agenda •About me •Overview •Preamble •Migrate database and user profiles • Legacy profile documents vs. Java Beans • Value lists made available over the whole application •User and environment information • What can a user see and use? •Extending Fulltext search to a facetted search • Filtering your data with meta tags
  3. 3. Oliver Busse • „Bleeding Yellow“ since 2000 • Working for We4IT Group • OpenNTF Board Member • IBM Champion for ICS in 2015 • @zeromancer1972 • www.oliverbusse.com www.we4it.com
  4. 4. Overview •What‘s this? • Transforming & re-using commonly used legacy patterns in XPages • Don‘t fear Java  • Avoid @Formulas in SSJS • Ideas for best practices •What‘s it not? • An XPages Introduction • A Java beginner‘s guide • A complete application migration strategy
  5. 5. Preamble •Why not to use SSJS „excessively“? • SSJS is interpreted at runtime • SSJS is compiled at runtime (every time you call it!) • Compiled SSJS is hard to debug while executed
  6. 6. 6#engageug Migrating database and user profiles
  7. 7. What we find in legacy apps: profile documents Disadvantages • You cannot see them without using tools • You can edit and create them only programmatically • Sometimes replication issues • Unwanted Caching ;-) Advantages • Quick access without using lookup views • Caching
  8. 8. What we missed in many cases DatabaseScript != Global Declarations Encapsuled, no access from outside (except Database Events)
  9. 9. Performance-Killer Numerous usage of those formulas slow down the app one of many...
  10. 10. Transformation Item1=Values1 Item2=Values2 Item3=Values3 ... NotesDocument Key1=ValueMap1 Key2=ValueMap2 Key3=ValueMap3 ... HashMap NSF-based, view lookup Memory-based, direct access
  11. 11. Ingredients •Transformation of profile documents to „standard“ documents 1. Create a corresponding lookup view 2. Optional: corresponding forms for maintenance 3. Create the Java Bean classes 4. Define those Bean classes in faces-config.xml
  12. 12. Preparation: Lookup Views •Key for Database Profiles = dbprofile •Key for User Profiles = Canonical User Name •Key for Value Lists = free but unique
  13. 13. Preparation: Java Beans • 3 Classes: • DatabaseProfileBean • AppConfigBean • UserProfileBean • The DatabaseProfileBean initializes the document if it doesn‘t exist • The UserProfileBean initializes the document when the user saves it for the first time
  14. 14. faces-config.xml <faces-config> <!-- Database Profile Bean --> <managed-bean> <managed-bean-name>dbprofile</managed-bean-name> <managed-bean-class>com.icsug.DatabaseProfileBean </managed-bean-class> <managed-bean-scope>application</managed-bean-scope> </managed-bean> <!-- User Profile Bean --> <managed-bean> <managed-bean-name>userprofile</managed-bean-name> <managed-bean-class>com.icsug.UserProfileBean </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <!-- Application Configuration --> <managed-bean> <managed-bean-name>application</managed-bean-name> <managed-bean-class>com.icsug.AppConfigBean </managed-bean-class> <managed-bean-scope>application</managed-bean-scope> </managed-bean> </faces-config>
  15. 15. Digression: Bean Scopes & Lifecycles •Request • Lives beginning with the request to creation of the response •View • Within a page until changing the page, even during partial refreshes •Session • Per user session •Application • During the life time of th application (after 30 minutes it is dropped by default)
  16. 16. DEMO
  17. 17. 17#engageug User and Environment Information
  18. 18. User and Environment Information Name variations Access Level ACL Options notes.ini variables Environment Bean
  19. 19. faces-config.xml: EnvironmentBean 19#engageug <?xml version="1.0" encoding="UTF-8"?> <faces-config> <!-- Environment Bean --> <managed-bean> <managed-bean-name>env</managed-bean-name> <managed-bean-class>com.icsug.EnvironmentBean </managed-bean-class> <managed-bean-scope>view</managed-bean-scope> </managed-bean> </faces-config>
  20. 20. Example: Username Variations <p> <xp:label value="#{javascript:env.userName}" id="label1"> </xp:label> </p> <p> <xp:label value="#{javascript:env.commonUserName}" id="label2"> </xp:label> </p> <p> <xp:label value="#{javascript:env.abbreviatedUserName}" id="label3"> </xp:label> </p>
  21. 21. Example: ACL Options The delete button is only visible if the user can delete documents
  22. 22. Even in themes! 22#engageug <theme extends="flatly" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="platform:/plugin/com.ibm.designer.domino.style kits/schema/stylekit.xsd"> <!-- display a submit type button only if user can create documents via ACL --> <control> <name>Button.Submit</name> <property type="boolean"> <name>rendered</name> <value>#{env.createDocuments}</value> </property> </control> </theme>
  23. 23. DEMO
  24. 24. 24#engageug Extending Fulltext-Search to a Facetted Search
  25. 25. Facetted Search „Faceted search, also called faceted navigation or faceted browsing, is a technique for accessing information organized according to a faceted classification system, allowing users to explore a collection of information by applying multiple filters.“ http://en.wikipedia.org/wiki/Faceted_search
  26. 26. Facetted Search
  27. 27. „Well-known“ Examples amazing.com cyberharbor muse
  28. 28. Facetted Search with Domino? 1. Fulltext Search 2. Filtering result from extra meta data 1. Meta data search with facet selection 2. Fulltext Search in results
  29. 29. FacettedSearchBean (Session scoped) FacetsSearch Term FacettedSearch Bean DocumentCollection (ArrayList<SearchResultEntry>)
  30. 30. 30#engageug DEMO
  31. 31. Facetted Search: Outlook & Alternatives •Using OpenNTF API‘s Graph-DB functions •Using a 3rd party Graph-DB like Apache Solr 31#engageug
  32. 32. Want to get the DEMO? Grab it from my Bitbucket repo (also contains an NTF): https://bitbucket.org/zeromancer1972/icsug-2015-demo It uses the following plugins available on OpenNTF: XPages Extension Library (9.0.1.07+): http://extlib.openntf.org/ Bootstrap 4 Xpages: http://www.openntf.org/main.nsf/project.xsp?r=project/Bootstrap4XPages OpenNTF Domino API: http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20 API 32#engageug
  33. 33. Q & A 33#engageug
  34. 34. Other Resources http://en.wikipedia.org/wiki/Faceted_search http://lucene.apache.org/solr/ https://www.focul.net/focul-best-practice-faceted-filtering-xpages-using-java-beans/

×