SlideShare a Scribd company logo
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

More Related Content

Similar to 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
ICS User Group
 
Integrating Maven with Eclipse
Integrating Maven with EclipseIntegrating Maven with Eclipse
Integrating Maven with Eclipse
Nikhil 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.docx
whittemorelucilla
 
How java works
How java worksHow java works
How java works
thiruvenkatz
 
How java works
How java worksHow java works
How java works
RaxTonProduction
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
Max 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 - cassandra
JWORKS 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 Results
Steve Keener
 
Exploit Frameworks
Exploit FrameworksExploit Frameworks
Exploit Frameworks
phanleson
 
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
Odd-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 Eclipse
Jeanne Boyarsky
 
Java tutorial
Java tutorialJava tutorial
Java tutorial
shalsmart12
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Scholarhat
 
JavaServer Faces Introduction by Example Juneau Josh
JavaServer Faces Introduction by Example Juneau JoshJavaServer Faces Introduction by Example Juneau Josh
JavaServer Faces Introduction by Example Juneau Josh
lucnoryssel
 
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
drupalindia
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
hossein helali
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programs
greenwop
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie 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 Users
Andrew Bayer
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
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
ICS User Group
 
Integrating Maven with Eclipse
Integrating Maven with EclipseIntegrating Maven with Eclipse
Integrating Maven with Eclipse
Nikhil 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.docx
whittemorelucilla
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
Max 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 - cassandra
JWORKS 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 Results
Steve Keener
 
Exploit Frameworks
Exploit FrameworksExploit Frameworks
Exploit Frameworks
phanleson
 
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
Odd-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 Eclipse
Jeanne Boyarsky
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Scholarhat
 
JavaServer Faces Introduction by Example Juneau Josh
JavaServer Faces Introduction by Example Juneau JoshJavaServer Faces Introduction by Example Juneau Josh
JavaServer Faces Introduction by Example Juneau Josh
lucnoryssel
 
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
drupalindia
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programs
greenwop
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie 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 Users
Andrew Bayer
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 

More from 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
ICS 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.1
ICS 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-ssjs
ICS 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-know
ICS 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&out
ICS 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_applications
ICS 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-kaffeepause
ICS 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_data
ICS 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-beyond
ICS 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-admins
ICS User Group
 
bccon-2014-welcome
bccon-2014-welcomebccon-2014-welcome
bccon-2014-welcome
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-business
ICS 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.1
ICS 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-ssjs
ICS 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-know
ICS 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&out
ICS 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_applications
ICS 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-kaffeepause
ICS 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_data
ICS 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-beyond
ICS 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-admins
ICS User Group
 
Ad

Recently uploaded (20)

Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Ad

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