SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a 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
 

Similar a 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
 

Más 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
 

Más 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
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

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