SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
1
Coffee from a Friend:
Using Third Party Java Libraries
2014/03/18– Matthew Fyleman
2
 Matthew Fyleman
 21 YearsasaNotes/Domino Developer
 MostlyWorking on:
 Xpagesconversions
 Product development
Who AmI?
3
 Based on MyExperiences
 Beginner Level!
 Using JavaGenerally in XPages
 Will focuson .jar files, but will look at other
waysof incorporating Java
 What to usewhen
What isthisTalk About?
4
 Why Java?
 Advantagesover SSJS
 Java Options
 Prepackaged Options
 .jarspackaged into Extension Libraries
 OpenNTF.org
 ApachePOI Example
 Raw Libraries
 Deploying
 Incorporation
 Security
 Creating .jars
 Questions
What amI talking about?
5
It hasa better structure than ssjs
 Stronglytyped
 Object Oriented fromtheground up
It‘sa very useful skill
 Widelyused outsideNotes/Domino
 Encouragesbetter programming practise
Why Java?– 1. Thebasics
6
<<Demonstration>>
Why Java?– 2. ItsFaster than SSJS
But not asmuch asyou might think!
7
Seealso Stephan Wissel‘sblog post:
http://www.wissel.net/blog/d6plinks/SHWL-8SLCVR
Why Java?– 3. ItsEasier to Debug
8
Why Java?– 4. ThereareLotsof 3rd Party Libraries
 AdobeAcrobat (PDF) Manipulation
 Word and Excel Creation and Modification
 XMLparsing
 ... Many more
 If you need it, thereisprobably a Java
library out there
 Tested and stable(relatively!)
9
 Raw Java
 You’realreadydoing this!
 JavaClassFiles
 Better for development
 .jarsprovideobfuscation
 .jarsareeasilyportable– writeonceuseanywhere
 Managed Beans
 Much easier to createthan you might think
 Automatically work within ascope
 .jar Files
Java Options
10
 Almost certainly donethisalready:
 var vecThis= new java.util.Vector();
 Can Import Packages
 importPackage(java.util);
 var vecThis= new Vector();
 Can beadisadvantage, particularly for beginners!
Java Options– Raw Java
11
 Easyto create
 In thecodesection under Java
 Createnew java class
Java Options– ClassFiles
12
 Need to generate constructor?
 Under thesourcemenu
 GenerateConstructor using ...
 Gettersand Setters?
 Samemenu
 Correct indentation?
 Samemenu
Java Options– Getting Help FromEclipse
13
Rulesfor Managed Beans
 If you haveaconstructor, it must beparameterless
 Fieldsin your classareonlypublically accessiblethrough gettersand
setters
 To support persistenceit should implement theSerializableinterface
 It needsan entryin thefaces-config.xml file
 SeePer Laustenspage‘Creating Your First managed bean for
Xpages’
http://per.lausten.dk/blog/2012/02/creating-your-first-
managed-bean-for-xpages.html
Java Options– Managed Beans
14
 You are probably not the first!
 Check OpenNTF.org
 Pre-Packaged into an Extension Library
 Easyto Use
 Documentation (?)
 Onceext lib installed, no securitysettingsto
think about
Pre-Packaged Options
15
 Demonstration
Pre-Packaged Options
16
 Not AlwaysAvailable
 Extension Librariesneed to be
deployed to the server!
 What can you do if thisisnot an option?
Pre-Packaged Options- Issues
17
 Thiswasthesituation I found myself in on arecent project
 Customer needed .docx filemanipulation
 Customer would not permit third party deployment to the
server
 Deployed thePOI Libswithin myApplication
 No Deployment to theServer (technically speaking!)
 Simple
 Still had accessto theFunctionality
UsetheLibrary‘RAW‘
18
 ThreeOptions:
1. Deployto theserver filesystem
 Non-starter
2. Deployunder WEB-INF
 Better but onlyuseif you are8.5.2 or lower
3. Deployto jar areaunder ‘code‘
 Best option
Deployment Options
19
 Java Librariesfor manipulatingMicrosoft Word and
Excel files
 Open Source
 Main library ispoi-3.9-20121203.jar
 But you will need othersparticularly if you wish to
work on docx and xlsx
 dom4j-1.6.1.jar
 stax-api-1.0.1.jar
 xmlbeans-2.3.0.jar
ApachePOI Project
20
 To create an Excel spreadsheet using POI, have your
code perform the following steps:
 Createaworkbook object:
var xl=new org.apache.poi.hssf.usermodel.HSSFWorkbook();
 Add asheet to theworkbook:
var sheet = xl.createSheet("Sheet 1");
ApachePOI Creating aSpreadsheet
21
 Add arow to thesheet
 They start at 0
row = sheet.createRow(rowCount++);
 Writedatainto cellsinto each row
cell = row.createCell((java.lang.Integer)(cellCount++));
cell.setCellValue(document.getItemValueString(“AField”));
 Watch out!
ApachePOI Creating aSpreadsheet
22
 Demonstration
Deployment
23
 Sooner or later you will hit this
 Need to edit the‘java.policy’ file
 Proper wayisto databasespecificentry
 For Production Systems
 Doesn’t work on Domino 9 ?
 For Dev EnvironmentsYou Can Cheat!
grant { permission java.security.AllPermission; };
 Seeblog post ‘JavaSecurity in Xpages’ fromStephan Wissel:
 http://www.wissel.net/blog/d6plinks/SHWL-8JYAT5
 don‘t missNathan Freeman‘scomment!
Deployment - SecurityIssues
24
 Similar to working with Excel:
 Get thedocument
 Get document’sparagraphs
 Get thetext runsin theparagraphs
 Search and replacein text runs
 Get thetables
 Iteratethrough therows
 Iteratethrough thecells
 Do paragraph search and replacein each cell
ApachePOI Search and Replacein Word
25
 Java Librariesfor manipulating AdobeAcrobat
(pdf) documents
 Open Source– but ApacheLicense!
 Main library isitextpdf-5.5.0.jar
 UnlikePOI, thisisall you need for basicPDFs
iTextPdf
26
 Itsopen sourceso itsfree, right?
 Maybe, but check thelicense
 E.g. ApacheLicense
 Freeto useif your softwareisalso distributed under an
ApacheLicense
 Otherwisetheremaybeafeefor commercial use
 iText – OEM license, 125 desktops, approx. $3,000
Deployment - LicenseIssues
27
 Doing a lot of @Formula conversion to SSJS
 Encountering a lot of List Ops
 SSJShasno built in permutation operations
 Wanted alibrary of List Op utilities
What About MyOwn .jars
28
In Domino:
 Createtheclassfiles
 Test and debug
 Go to packageexplorer view
 Fileexport
 Createthe.jar
 Deployinto your database
- Simple!
MyOwn jar
29
 We4IT– www.we4it.com
 OpenNTF– www.openntf.org
 Ulrich Krause– www.eknori.de
 Wissel.net – Stephan Wissel‘sblog
 XpagesPortableCommand Guide–
Martin Donnelly et. al., IBM Press
Resourcesand Information
30
Questions?
31
matthew.fyleman@we4it.com

Contenu connexe

Similaire à bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries

Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesIcsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesICS User Group
 
Integrating Maven with Eclipse
Integrating Maven with EclipseIntegrating Maven with Eclipse
Integrating Maven with EclipseNikhil Bharati
 
Google Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docxGoogle Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docxwhittemorelucilla
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Max De Marzi
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandraJWORKS powered by Ordina
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
Exploit Frameworks
Exploit FrameworksExploit Frameworks
Exploit Frameworksphanleson
 
Sai devops - the art of being specializing generalist
Sai   devops - the art of being specializing generalistSai   devops - the art of being specializing generalist
Sai devops - the art of being specializing generalistOdd-e
 
Get ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
Get ready for FRC 2015: Intro to Java 5 through 8 updates and EclipseGet ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
Get ready for FRC 2015: Intro to Java 5 through 8 updates and EclipseJeanne Boyarsky
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesdrupalindia
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programsgreenwop
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With SeleniumJodie Miners
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersAndrew Bayer
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ NovellVincenzo Barone
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys AdminsPuppet
 

Similaire à bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries (20)

Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-librariesIcsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
Icsug conf 14_dev02_xpages-coffe-from-a-friend-using-third-party-java-libraries
 
Integrating Maven with Eclipse
Integrating Maven with EclipseIntegrating Maven with Eclipse
Integrating Maven with Eclipse
 
Google Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docxGoogle Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docx
 
How java works
How java worksHow java works
How java works
 
How java works
How java worksHow java works
How java works
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandra
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Exploit Frameworks
Exploit FrameworksExploit Frameworks
Exploit Frameworks
 
Sai devops - the art of being specializing generalist
Sai   devops - the art of being specializing generalistSai   devops - the art of being specializing generalist
Sai devops - the art of being specializing generalist
 
Get ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
Get ready for FRC 2015: Intro to Java 5 through 8 updates and EclipseGet ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
Get ready for FRC 2015: Intro to Java 5 through 8 updates and Eclipse
 
Java tutorial
Java tutorialJava tutorial
Java tutorial
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programs
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ Novell
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 

Plus de ICS User Group

bccon-2014 str05 ibm-smart_cloud-for-social-business
bccon-2014 str05 ibm-smart_cloud-for-social-businessbccon-2014 str05 ibm-smart_cloud-for-social-business
bccon-2014 str05 ibm-smart_cloud-for-social-businessICS User Group
 
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1ICS User Group
 
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjs
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjsbccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjs
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjsICS User Group
 
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowbccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowICS User Group
 
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outbccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outICS User Group
 
bccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsbccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsICS User Group
 
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepausebccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepauseICS User Group
 
bccon-2014 adm06 hony,_i_shrunk_the_data
bccon-2014 adm06 hony,_i_shrunk_the_databccon-2014 adm06 hony,_i_shrunk_the_data
bccon-2014 adm06 hony,_i_shrunk_the_dataICS User Group
 
bccon-2014 adm05 ibm traveler-2013-and-beyond
bccon-2014 adm05 ibm traveler-2013-and-beyondbccon-2014 adm05 ibm traveler-2013-and-beyond
bccon-2014 adm05 ibm traveler-2013-and-beyondICS User Group
 
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-adminsbccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-adminsICS User Group
 

Plus de ICS User Group (11)

bccon-2014 str05 ibm-smart_cloud-for-social-business
bccon-2014 str05 ibm-smart_cloud-for-social-businessbccon-2014 str05 ibm-smart_cloud-for-social-business
bccon-2014 str05 ibm-smart_cloud-for-social-business
 
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1
bccon-2014 str06 ibm-notes-browser-plug-in_9.0.1
 
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjs
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjsbccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjs
bccon-2014 dev03 xpages-road_to_damascas-lotus-script-and-@formula-to-ssjs
 
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowbccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
 
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outbccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&out
 
bccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsbccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applications
 
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepausebccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
 
bccon-2014 adm06 hony,_i_shrunk_the_data
bccon-2014 adm06 hony,_i_shrunk_the_databccon-2014 adm06 hony,_i_shrunk_the_data
bccon-2014 adm06 hony,_i_shrunk_the_data
 
bccon-2014 adm05 ibm traveler-2013-and-beyond
bccon-2014 adm05 ibm traveler-2013-and-beyondbccon-2014 adm05 ibm traveler-2013-and-beyond
bccon-2014 adm05 ibm traveler-2013-and-beyond
 
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-adminsbccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-admins
 
bccon-2014-welcome
bccon-2014-welcomebccon-2014-welcome
bccon-2014-welcome
 

Dernier

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries

  • 1. 1 Coffee from a Friend: Using Third Party Java Libraries 2014/03/18– Matthew Fyleman
  • 2. 2  Matthew Fyleman  21 YearsasaNotes/Domino Developer  MostlyWorking on:  Xpagesconversions  Product development Who AmI?
  • 3. 3  Based on MyExperiences  Beginner Level!  Using JavaGenerally in XPages  Will focuson .jar files, but will look at other waysof incorporating Java  What to usewhen What isthisTalk About?
  • 4. 4  Why Java?  Advantagesover SSJS  Java Options  Prepackaged Options  .jarspackaged into Extension Libraries  OpenNTF.org  ApachePOI Example  Raw Libraries  Deploying  Incorporation  Security  Creating .jars  Questions What amI talking about?
  • 5. 5 It hasa better structure than ssjs  Stronglytyped  Object Oriented fromtheground up It‘sa very useful skill  Widelyused outsideNotes/Domino  Encouragesbetter programming practise Why Java?– 1. Thebasics
  • 6. 6 <<Demonstration>> Why Java?– 2. ItsFaster than SSJS But not asmuch asyou might think!
  • 7. 7 Seealso Stephan Wissel‘sblog post: http://www.wissel.net/blog/d6plinks/SHWL-8SLCVR Why Java?– 3. ItsEasier to Debug
  • 8. 8 Why Java?– 4. ThereareLotsof 3rd Party Libraries  AdobeAcrobat (PDF) Manipulation  Word and Excel Creation and Modification  XMLparsing  ... Many more  If you need it, thereisprobably a Java library out there  Tested and stable(relatively!)
  • 9. 9  Raw Java  You’realreadydoing this!  JavaClassFiles  Better for development  .jarsprovideobfuscation  .jarsareeasilyportable– writeonceuseanywhere  Managed Beans  Much easier to createthan you might think  Automatically work within ascope  .jar Files Java Options
  • 10. 10  Almost certainly donethisalready:  var vecThis= new java.util.Vector();  Can Import Packages  importPackage(java.util);  var vecThis= new Vector();  Can beadisadvantage, particularly for beginners! Java Options– Raw Java
  • 11. 11  Easyto create  In thecodesection under Java  Createnew java class Java Options– ClassFiles
  • 12. 12  Need to generate constructor?  Under thesourcemenu  GenerateConstructor using ...  Gettersand Setters?  Samemenu  Correct indentation?  Samemenu Java Options– Getting Help FromEclipse
  • 13. 13 Rulesfor Managed Beans  If you haveaconstructor, it must beparameterless  Fieldsin your classareonlypublically accessiblethrough gettersand setters  To support persistenceit should implement theSerializableinterface  It needsan entryin thefaces-config.xml file  SeePer Laustenspage‘Creating Your First managed bean for Xpages’ http://per.lausten.dk/blog/2012/02/creating-your-first- managed-bean-for-xpages.html Java Options– Managed Beans
  • 14. 14  You are probably not the first!  Check OpenNTF.org  Pre-Packaged into an Extension Library  Easyto Use  Documentation (?)  Onceext lib installed, no securitysettingsto think about Pre-Packaged Options
  • 16. 16  Not AlwaysAvailable  Extension Librariesneed to be deployed to the server!  What can you do if thisisnot an option? Pre-Packaged Options- Issues
  • 17. 17  Thiswasthesituation I found myself in on arecent project  Customer needed .docx filemanipulation  Customer would not permit third party deployment to the server  Deployed thePOI Libswithin myApplication  No Deployment to theServer (technically speaking!)  Simple  Still had accessto theFunctionality UsetheLibrary‘RAW‘
  • 18. 18  ThreeOptions: 1. Deployto theserver filesystem  Non-starter 2. Deployunder WEB-INF  Better but onlyuseif you are8.5.2 or lower 3. Deployto jar areaunder ‘code‘  Best option Deployment Options
  • 19. 19  Java Librariesfor manipulatingMicrosoft Word and Excel files  Open Source  Main library ispoi-3.9-20121203.jar  But you will need othersparticularly if you wish to work on docx and xlsx  dom4j-1.6.1.jar  stax-api-1.0.1.jar  xmlbeans-2.3.0.jar ApachePOI Project
  • 20. 20  To create an Excel spreadsheet using POI, have your code perform the following steps:  Createaworkbook object: var xl=new org.apache.poi.hssf.usermodel.HSSFWorkbook();  Add asheet to theworkbook: var sheet = xl.createSheet("Sheet 1"); ApachePOI Creating aSpreadsheet
  • 21. 21  Add arow to thesheet  They start at 0 row = sheet.createRow(rowCount++);  Writedatainto cellsinto each row cell = row.createCell((java.lang.Integer)(cellCount++)); cell.setCellValue(document.getItemValueString(“AField”));  Watch out! ApachePOI Creating aSpreadsheet
  • 23. 23  Sooner or later you will hit this  Need to edit the‘java.policy’ file  Proper wayisto databasespecificentry  For Production Systems  Doesn’t work on Domino 9 ?  For Dev EnvironmentsYou Can Cheat! grant { permission java.security.AllPermission; };  Seeblog post ‘JavaSecurity in Xpages’ fromStephan Wissel:  http://www.wissel.net/blog/d6plinks/SHWL-8JYAT5  don‘t missNathan Freeman‘scomment! Deployment - SecurityIssues
  • 24. 24  Similar to working with Excel:  Get thedocument  Get document’sparagraphs  Get thetext runsin theparagraphs  Search and replacein text runs  Get thetables  Iteratethrough therows  Iteratethrough thecells  Do paragraph search and replacein each cell ApachePOI Search and Replacein Word
  • 25. 25  Java Librariesfor manipulating AdobeAcrobat (pdf) documents  Open Source– but ApacheLicense!  Main library isitextpdf-5.5.0.jar  UnlikePOI, thisisall you need for basicPDFs iTextPdf
  • 26. 26  Itsopen sourceso itsfree, right?  Maybe, but check thelicense  E.g. ApacheLicense  Freeto useif your softwareisalso distributed under an ApacheLicense  Otherwisetheremaybeafeefor commercial use  iText – OEM license, 125 desktops, approx. $3,000 Deployment - LicenseIssues
  • 27. 27  Doing a lot of @Formula conversion to SSJS  Encountering a lot of List Ops  SSJShasno built in permutation operations  Wanted alibrary of List Op utilities What About MyOwn .jars
  • 28. 28 In Domino:  Createtheclassfiles  Test and debug  Go to packageexplorer view  Fileexport  Createthe.jar  Deployinto your database - Simple! MyOwn jar
  • 29. 29  We4IT– www.we4it.com  OpenNTF– www.openntf.org  Ulrich Krause– www.eknori.de  Wissel.net – Stephan Wissel‘sblog  XpagesPortableCommand Guide– Martin Donnelly et. al., IBM Press Resourcesand Information