SlideShare a Scribd company logo
BP107: Ten Lines Or Less
Interesting Things You Can Do In
Java With Minimal Code
Julian Robichaux, panagenda
Kathy Brown, PSC Group
Why are we here?
▪ Java snippets for IBM Notes® and Domino®
- 10 lines or less
- beginner-to-intermediate level stuff
- hopefully useful
▪ Integration tips
- XPages only
- Gotchas
▪ Sample database
- http://www.runningnotes.net and/or http://nsftools.com/blog
The 10-Line Rules
Rule #1
The method signature is not part of the line count
   public  String  getFoo()  {  
      return  "foo";  
   }
This only
counts as one
line
The 10-Line Rules
Rule #2
A single line with linefeeds added for readability is still just one line
   public  String  getFoos()  {  
      return  "foo"  +    
                 "foo"  +    
                 "foofoofoo";  
   }
This only
counts as one
line
The 10-Line Rules
Rule #3
We make the rules
   public  String  getFoot()  {  
      Foot  foot  =  new  Foot();  
      foot.addToes(12).makeHairy();  
      return  foot.toString();  
   }
This is as many
lines as we say
it is
The 10-Line Rules
Rule #4
Error handling and object cleanup has sometimes been omitted for brevity
PLEASE use good error handling in your production code
About the Sample Application
▪ As you travel, you can upload pictures from your smartphone to this app
▪ Upon upload, the app will:
- Read GPS data from the picture
- Use a web service to obtain the address
- Create a thumbnail of the photo
- Embed the thumbnail into a rich text field
▪ Other functionality:
- Return info as JSON
- Return info as a spreadsheet
- FTP to a server
GETTING STARTED
The basics. Where does this stuff go? How do we access Notes objects?
Where does our Java code live?
▪ How to add Java design elements to Code > Java and Code > Jars
- Jars can be copy/pasted, or dragged/dropped, or “Import Jar”
- Java classes can be copy/pasted, dragged/dropped, or “Create New Class”

▪ What’s the difference?
- A Jar (Java ARchive) file is a file containing one or more Java classes
Where does our Java code live?
▪ NOTE: XPages only, agents are different
- Agents don’t have access to Java design elements

▪ Just code for now, we’ll tackle external libraries later

▪ Java code can also go in WebContent/WEB-INF/lib or on the host system
- Paul Calhoun and Paul Della-Nebbia have several slides on benefits of each location in their
Java Jumpstart, http://www.slideshare.net/Teamstudio/java-for-xpages-development
Java 1.5
▪ IBM Notes/Domino 8.5 and 9.0 uses Java 1.6 as a JVM
▪ Java design elements (for XPages) compile to version 1.5 by default
- Enhanced for loops
- Auto-boxing
- Enums
- Generics
▪ Java agents compile to version 1.2 by default
- Can be changed with notes.ini variable: JavaCompilerTarget
- Agents might not run on older clients or servers
Example: Getting Document Attachments [1]
   public  EmbeddedObject  getFirstDocAttachment(Document  doc)    
               throws  NotesException  {  
      Session  session  =  doc.getParentDatabase().getParent();  
      Vector  atts  =  session.evaluate("@AttachmentNames",  doc);  
      String  firstFile  =  (String)atts.get(0);  
      if  (firstFile.length()  >  0)  {  
         EmbeddedObject  eo  =  doc.getAttachment(firstFile);  
         return  eo;  
      }  
      return  null;  
   }
Here’s one
way to get a
Notes
Session
Everything else is
pretty much like
LotusScript
Example: Getting Document Attachments [2]
   public  EmbeddedObject  getFirstRichTextAttachment(RichTextItem  rtItem)  
               throws  NotesException  {  
      Vector  atts  =  rtItem.getEmbeddedObjects();  
      for  (Iterator  iterator  =  atts.iterator();  iterator.hasNext();)  {  
         EmbeddedObject  eo  =  (EmbeddedObject)  iterator.next();  
         if  (eo.getType()  ==  EmbeddedObject.EMBED_ATTACHMENT)  {  
            return  eo;  
         }  
      }  
      return  null;  
   }
Notes API still uses
Vectors quite often
as return objects
Iterator loop, in
case you want to
use this in an agent
Passing Current Document and Calling Java
importPackage(com.lotusphere.bp107_2015);  
var  doc:NotesDocument  =  currentDocument.getDocument();  
var  eo:lotus.domino.EmbeddedObject  =  TenLinesOrLess.getFirstDocAttachment(doc)
public  static  EmbeddedObject  getFirstDocAttachment(Document  doc)  
throws  NotesException  {  
      Session  session  =  doc.getParentDatabase().getParent();  
      Vector  atts  =  session.evaluate("@AttachmentNames",  doc);  
      String  firstFile  =  (String)atts.get(0);  
      if  (firstFile.length()  >  0)  {  
         EmbeddedObject  eo  =  doc.getAttachment(firstFile);  
         return  eo;  
      }  
      return  null;  
   }
JavaScript
Java
WORKING WITH FILES
Reading, writing, and accessing files. Permissions, considerations, and
working with byte arrays directly.
Basic File IO
▪ Java keeps improving file IO classes
- Java 1.5 added Closable interfaces
- Java 1.7 added java.nio.file classes (“Files” is especially useful)
- http://docs.oracle.com/javase/tutorial/essential/io/legacy.html 

▪ By default, Notes/Domino Java elements compile to Java 1.5 compatible code
- You can change to 1.6 in project properties, but this might break things
- No significant java.io changes in 1.6 anyway: 

http://docs.oracle.com/javase/6/docs/technotes/guides/io/enhancements.html
Example: Reading a Text File into a String [1]
   public  String  readTextFileScanner(String  fileName)  throws  IOException  {  
      //  Scanner  can  be  flaky  about  sometimes  not  returning  all  the  data,    
      //  and  can  be  slower  because  it's  using  regex  internally  
      StringBuilder  text  =  new  StringBuilder();  
      String  crlf  =  System.getProperty("line.separator");  
      Scanner  scanner  =  new  Scanner(new  FileInputStream(fileName),  "UTF-­‐8");  
      while  (scanner.hasNextLine()){  
         text.append(scanner.nextLine()  +  crlf);  
      }  
      scanner.close();  
      return  text.toString();  
   } using the right
character set is
important!
Scanner can be flaky on large
strings, and you might be
replacing n with rn for linefeeds
Example: Reading a Text File into a String [2]
   public  String  readTextFileReader(String  fileName)  throws  IOException  {  
      //  StringBuilder  is  faster  than  StringBuffer  because  it's  not  
      //  synchronized  
      StringBuilder  sb  =  new  StringBuilder();  
      BufferedReader  reader  =  new  BufferedReader(  
            new  InputStreamReader(new  FileInputStream(fileName),  "UTF-­‐8"));  
      char[]  buffer  =  new  char[1024];  
      int  size  =  0;  
      while((size  =  reader.read(buffer))  !=  -­‐1)  {  
         sb.append(buffer,  0,  size);  
      }  
      reader.close();  
      return  sb.toString();  
   }
again with the
character seta tiny bit more work,
but slightly faster
and probably more
reliable
Example: Writing a File to Another File [1]
   public  void  copyFileChannel(String  fileToRead,  String  fileToWrite)    
               throws  IOException  {  
      //  you  should  add  try/finally  blocks  to  make  sure  streams  get  closed  
      FileInputStream  in  =  new  FileInputStream(fileToRead);  
      FileOutputStream  out  =  new  FileOutputStream(fileToWrite,  false);  
      //  FileChannel  is  faster  but  generally  uses  more  memory;  you  can    
      //  control  this  somewhat  by  using  FileChannel.map()  
      FileChannel  channel1  =  in.getChannel();  
      FileChannel  channel2  =  out.getChannel();  
      channel1.transferTo(0,  channel1.size(),  channel2);  
      //  closing  the  streams  also  closes  the  channels  
      in.close();  
      out.close();  
   }
FileChannel is fast but uses more
memory. You can use memory mapping
(and more code) for better control.
Example: Writing a File to Another File [2]
   public  void  copyFileStream(String  fileToRead,  String  fileToWrite)    
               throws  IOException  {  
      //  you  should  add  try/finally  blocks  to  make  sure  streams  get  closed  
      FileInputStream  in  =  new  FileInputStream(fileToRead);  
      FileOutputStream  out  =  new  FileOutputStream(fileToWrite,  false);  
      byte[]  buffer  =  new  byte[1024];  
      int  size  =  0;  
      while((size  =  in.read(buffer))  !=  -­‐1)  {  
         out.write(buffer,  0,  size);  
      }  
      in.close();  
      out.close();  
   } Two extra lines of code, but
easier to stay in a smaller
memory footprint
Domino Server Permissions for File (and Network) Access
▪ Server doc, security fields
- EITHER: Unrestricted Methods
- OR: Sign XPages AND Run Restricted

▪ Dangers of reading/writing files directly to the server
- No delete access?
- Forgetting to delete
- File contention
- Angry admins
Working Directly with Byte Arrays
▪ In some cases, we can work directly with byte arrays
- Potentially avoid file IO and/or restrictions entirely

▪ Memory considerations
- It’s expensive to hold an entire file in memory
- Info and a few links about memory at the end of the presentation
Example: Accessing Embedded Objects [1]
         EmbeddedObject  eo  =  getFirstDocAttachment(doc);  
         File  tempFile  =  File.createTempFile("eo-­‐",  ".tmp");  
         eo.extractFile(tempFile.getAbsolutePath());
After you’re done
with the file, you are
responsible for
deleting it
Easy way to create
a temp file in the
temp folder
Example: Accessing Embedded Objects [2]
         EmbeddedObject  eo  =  getFirstDocAttachment(doc);  
         InputStream  in  =  new  BufferedInputStream(eo.getInputStream());
After you’re done
with the
InputStream, you
are responsible
for closing it
This actually
creates a temp
file in the
background
BufferedInputStream
supports mark/reset
(and it sometimes
speeds things up)
EmbeddedObject Temp Files
▪ If your temp directory looks like this, EmbeddedObject.getInputStream() is the culprit
- Check your code for Exceptions or missing/misplaced InputStream.close()
Create a Thumbnail and Embed the Image
▪ Steps:
- Get the file attachment as an InputStream however you want
- Resize the image using Java ImageIO
- Re-attach the image to a rich text field

▪ We will use a super-special magic technique to attach the image as an embedded image
instead of a file attachment

▪ NOTE: Julian went into more detail about image resizing in a presentation with Mark Myers
last year:
- http://www.slideshare.net/panagenda/show104-practical-java-30838547
Example: Create the Thumbnail Image
   public  byte[]  createThumbnail(InputStream  in,  float  size)  
               throws  IOException  {  
      BufferedImage  bi  =  ImageIO.read(in);  
      float  scale  =  Math.min(size/bi.getHeight(),  size/bi.getWidth());  
      BufferedImage  thumb  =  new  BufferedImage(bi.getWidth(),    
            bi.getHeight(),  bi.getType());  
      AffineTransformOp  op  =  new  AffineTransformOp  
               (AffineTransform.getScaleInstance(scale,  scale),    
               AffineTransformOp.TYPE_BICUBIC);  
      thumb  =  op.filter(bi,  thumb);  
      thumb  =  thumb.getSubimage(0,  0,    
               (int)(bi.getWidth()*scale),  (int)(bi.getHeight()*scale));  
      ByteArrayOutputStream  baos  =  new  ByteArrayOutputStream();  
      ImageIO.write(thumb,  "jpg",  baos);  
      return  baos.toByteArray();  
   }
InputStream from an
EmbeddedObject or file
ByteArrayOutputStreams
are handy
Example: Create the Embedded Image in a MIME Field
   public  void  embedImageMIME(Document  doc,  String  fieldName,    
               byte[]  imageData,  String  mimeType,  String  fileName)    
               throws  NotesException  {  
      MIMEEntity  mime  =  doc.createMIMEEntity(fieldName);  
      MIMEHeader  hdr  =  mime.createHeader("MIME-­‐Version");  
      hdr.setHeaderValAndParams("1.0");  
      Session  session  =  doc.getParentDatabase().getParent();  
      Stream  stream  =  session.createStream();  
      stream.write(imageData);  
      //  NOTE:  JPG  images  must  be  MIME  type  "image/jpeg",  not  "image/jpg"  
      mime.setContentFromBytes(stream,    
            mimeType  +  ";  name=""  +  fileName  +  """,    
            MIMEEntity.ENC_IDENTITY_BINARY);  
      doc.closeMIMEEntities(true,  fieldName);  
   }
you just have to
add the data to
the MIME field
like this
Example: Create the Embedded Image in a Rich Text Field
   public  void  embedImageRichText(RichTextItem  rtitem,    
               byte[]  imageData,  String  mimeType,  String  fileName)    
               throws  NotesException  {  
      Database  db  =  rtitem.getParent().getParentDatabase();  
      Session  session  =  db.getParent();  
      Document  tempDoc  =  db.createDocument();  
      //  for  non-­‐image  MIME  types,  this  will  just  be  an  attachment  
      embedImageMIME(tempDoc,  "body",  imageData,  mimeType,  fileName);  
      boolean  isConvert  =  session.isConvertMime();  
      session.setConvertMime(true);  
      RichTextItem  tempItem  =  (RichTextItem)tempDoc.getFirstItem("body");  
      session.setConvertMime(isConvert);  
      rtitem.appendRTItem(tempItem);  
      tempDoc.recycle();  
   }
setConvertMime is
what changes the
MIME data to an
embedded image
THIRD PARTY LIBRARIES
Options for adding and using third party libraries.
How to Add Third Party Libraries
▪ You can add them just like we did with our “own” code
- Drag/drop, copy/paste, import, etc. into Jars, Java or WebContent
- Sometimes the build path gets lost
• In Package Explorer, right-click, Build Path > Configure Build Path

▪ You can create/use an OSGi plugin
- Here are some tutorials:
• http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Creating_an_XPages_Library
• http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Deploying_XPage_Libraries
How to Add Third Party Libraries
▪ You can put the JAR files in the /jvm/lib/ext directory
- Has to be on all servers the app is on
- Painful to make updates
- Admins don’t like this

▪ Security
- Third party code is, well, third party, so use code from trusted sources, like apache.org
- Might require changes to java.policy or similar
metadata-extractor Library
▪ Open-source (Apache 2) library for reading EXIF data from photo files
- https://drewnoakes.com/code/exif/index.html
- https://github.com/drewnoakes/metadata-extractor/releases
- http://javadoc.metadata-extractor.googlecode.com/git/2.7.0/index.html 

▪ Time/date, GPS, camera type, exposure, etc.
Example: Get GPS Data from a Photo
   public  double[]  getLatLong(InputStream  in)    
               throws  IOException,  ImageProcessingException  {  
      Metadata  metadata  =  ImageMetadataReader.readMetadata(in);  
      GpsDirectory  gpsDir  =    
               (GpsDirectory)metadata.getDirectory(GpsDirectory.class);  
      if  (gpsDir  !=  null)  {  
         GeoLocation  gps  =  gpsDir.getGeoLocation();  
         double[]  latLong  =    
               new  double[]{  gps.getLatitude(),  gps.getLongitude()  };  
         return  latLong;  
      }  
      return  null;  
   }
Easy way to populate
an array
Generating Barcodes and QR Codes
▪ ZXing library
- https://github.com/zxing/zxing
- Java and several other languages
- Open source, Apache 2.0 licensed

▪ Create several different types of 1D and 2D barcodes
- UPC, EAN, Code 128, QR Code, etc.
Example: Create a QR Code
   public  byte[]  createQrCode(String  text,  int  size)    
               throws  IOException,  WriterException  {  
      String  charset  =  "ISO-­‐8859-­‐1";  
      Hashtable  hints  =  new  Hashtable();  
      hints.put(EncodeHintType.CHARACTER_SET,  charset);  
        
      MultiFormatWriter  qwriter  =  new  MultiFormatWriter();  
      BitMatrix  qbits  =  qwriter.encode(text,  BarcodeFormat.QR_CODE,    
               size,  size,  hints);  
      ByteArrayOutputStream  out  =  new  ByteArrayOutputStream();  
      MatrixToImageWriter.writeToStream(qbits,  "png",  out);  
      return  out.toByteArray();  
   }
You could also write directly to a
file, embed this as an image, etc.
ISO-8859-1 is preferred for
QRCode text
ACCESSING WEB SITES
Making an HTTP connection, getting data, parsing XML
Connecting to External Websites
▪ URL classes (HTTP and HTTPS) are built-in to Java
- Apache HttpComponents are good if you need more fine-grained control
- http://hc.apache.org 

▪ Same security requirements as file access (see earlier slides)

▪ Additional steps required for proxy servers
- and possibly HTTPS, if certificates are not allowed

Maps, Addresses, and Geocoding
▪ Many online mapping services available
▪ Be mindful of license restrictions and requirements
- Sometimes the free services aren’t free at all
- Especially if you’re a corporation
▪ OpenStreetMap is an open-source alternative
- License: http://www.openstreetmap.org/copyright
- Maps API: http://wiki.openstreetmap.org/wiki/Develop
- Geocoding: http://wiki.openstreetmap.org/wiki/Nominatim
- Usage Policy: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
Example: Convert GPS Coordinates to Address (reverse geocoding)
   public  String  getAddress(double  latitude,  double  longitude)  throws  IOException  {  
      URL  url  =  new  URL("http://nominatim.openstreetmap.org/reverse?format=xml"  +    
            "&lat="  +  latitude  +  "&lon="  +  longitude  +  "&zoom=18&addressdetails=1");  
      InputStream  in  =  url.openStream();  
        
      try  {  
         DocumentBuilderFactory  factory  =  DocumentBuilderFactory.newInstance();  
         factory.setValidating(false);  
         org.w3c.dom.Document  domDoc  =  factory.newDocumentBuilder().parse(in);  
         Node    node  =  XPathAPI.selectSingleNode(domDoc,    
                  "/reversegeocode/result/text()");  
         return  node.getNodeValue();  
      }  catch  (Exception  ignored)  {  in.close();  }  
      return  null;  
   }
Make sure it’s “org.w3c.dom.Document”
and not lotus.domino.Document
Weirdly, this closes
the InputStream
after parsing
XML and XPath
▪ After your XML data has been parsed, you can:
- Step through the nodes to look for data (boring)
- Use XPath to search and extract specific nodes (fun!)

▪ XPath is a kind of query language for searching through XML
- Also used with XSL

▪ Getting started
- http://en.wikibooks.org/wiki/XPath/Basic_Syntax
- http://www.ibm.com/developerworks/xml/tutorials/x-xpath/x-xpath.html
OpenStreetMap Output and XPath
<?xml version="1.0" encoding="UTF-8"?>
<reversegeocode querystring="format=xml&amp;lat=51.46483333333333&amp;lon=-3.164&amp;zoom=18&amp;addressdetails=1"
attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" timestamp="Fri, 02 Jan 15
18:12:42 +0000">
<result lon="-3.1632088647976" lat="51.46474055" ref="Wales Millennium Centre" osm_id="26584146" osm_type="way"
place_id="60125628">Wales Millennium Centre, Roald Dahl Plass, Cardiff Bay, Cardiff, Wales, CF10 5AN, United Kingdom</result>
<addressparts>
<theatre>Wales Millennium Centre</theatre>
<pedestrian>Roald Dahl Plass</pedestrian>
<suburb>Cardiff Bay</suburb>
<city>Cardiff</city>
<county>Cardiff</county>
<state>Wales</state>
<postcode>CF10 5AN</postcode>
<country>United Kingdom</country>
<country_code>gb</country_code>
</addressparts>
</reversegeocode>
    Node  node  =  XPathAPI.selectSingleNode(domDoc,    
      "/reversegeocode/result/text()");
FTP
▪ For FTP, an easy (and small) library to use is Apache Commons Net
- http://commons.apache.org/proper/commons-net/index.html 

▪ Also supports FTPS, TFTP, and a few other protocols

▪ SFTP is different
- try http://www.jcraft.com/jsch
Example: Upload a File via FTP
   public  boolean  uploadFtpFile(String  server,  String  ftpFilePath,    
         InputStream  stream)  throws  IOException  {  
      boolean  result  =  false;  
      FTPClient  ftp  =  new  FTPClient();  
      ftp.connect(server);  
      if  (FTPReply.isPositiveCompletion(  ftp.getReplyCode()  ))  {  
         if  (ftp.login("anonymous",  "anonymous@example.com"))  {  
            ftp.setFileType(FTP.BINARY_FILE_TYPE);  
            result  =  ftp.storeFile(ftpFilePath,  stream);  
         }  
         ftp.disconnect();  
      }  
      return  result;  
   }
ftpFilePath like “file.doc”
or “/subdir/file.doc”
this will fail if ftpFilePath refers
to a subdir that doesn’t exist, or
if the file already exists and you
don’t have delete rights
Create a Button on the XPage to upload the attached photo via FTP
<xp:button  value="FTP  File"  id="button3"  refreshMode="complete">  
      <xp:eventHandler  event="onclick"  submit="true"  refreshMode="complete">  
         <xp:this.action><![CDATA[#{javascript:try  {  
importPackage(com.lotusphere.bp107_2015);  
var  doc:lotus.domino.Document  =  currentDocument.getDocument(true);  
var  eo:lotus.domino.EmbeddedObject  =  TenLinesOrLess.getFirstDocAttachment(doc);  
var  stream:java.io.InputStream  =  eo.getInputStream();  
var  streamIsOpen  =  true;  
TenLinesOrLess.uploadFtpFile("ftp.tardis.who",  "/ftp/important.txt",  stream);  
}  catch(e)  {  
_dump(e);  
}  finally  {  
if  (streamIsOpen)  {  
stream.close();  
}}}]]></xp:this.action></xp:eventHandler></xp:button>
XAGENTS AND OUTPUT
Using XAgents, collecting data, creating JSON, creating a spreadsheet,
sending info to the browser
What is an XAgent?
▪ What is it?
- An XPage that is not rendered, but can return JSON or XML or other data (like an agent does)
for use in charting, grids, exporting data, and more

▪ How do you create one? It’s as easy as 1-2-3
- We will show two examples, returning JSON and returning an Excel file
• Step one - create an XPage
• Step two - set rendered=“false”
• Step three - add some code to return some data
JSON in Java
▪ No native JSON support in Java (until maybe Java 9), must use third-party libraries
▪ Lots of popular options
- gson, jackson, etc.
- see the list at json.org
▪ Libraries that use reflection to create JSON from Objects are nice, but they generally
cause AccessControlExceptions with IBM Domino because they use reflection
- and they’re relatively large if you just want to create a JSON string
▪ json-simple is a nice, small (simple) choice
- http://code.google.com/p/json-simple
Example: Creating JSON
   public  String  createJson()  {  
      HashMap  values  =  new  LinkedHashMap();  
      values.put("value1",  "one");  
      values.put("value2",  2);  
        
      HashMap  subValues  =  new  LinkedHashMap();  
      subValues.put("subValue1",  new  Date());  
      subValues.put("subValue2",  System.currentTimeMillis());  
      values.put("value3",  subValues);  
        
      return  JSONObject.toJSONString(values);  
   }
HashMaps are awesome, and
LinkedHashMap retains order
You can put
Maps inside
of Maps
Java 1.5 auto-boxing lets us
use int instead of Integer
The JSON XAgent
<xp:view xmlns:xp=“http://www.ibm.com/xsp/core" rendered="false">
<xp:this.afterRenderResponse>
<![CDATA[#{javascript:
importPackage(java.lang);
importPackage(com.lotusphere.bp107_2015);
var myview:lotus.domino.View = database.getView("travelogvw");
var json = TenLinesOrLess.createJson(myview);
var externalContext = facesContext.getExternalContext();
var writer = facesContext.getResponseWriter();
var response = externalContext.getResponse();
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-cache");
writer.write(json);
writer.endDocument()
}]]></xp:this.afterRenderResponse></xp:view>
Call the Java code
JavaScript for the XAgent
Send the data
Set the HTTP header
Don’t render the XPage
Spreadsheets and Apache POI
▪ The go-to Java library for generating Excel spreadsheets is Apache POI
- http://poi.apache.org

▪ There are already a LOT of examples on how to use POI with XPages
- Please use your preferred search engine to discover them, we won’t play favorites

▪ But, can we create a spreadsheet with 10 lines or less…?
Example: Create a Spreadsheet with Apache POI
   public  HSSFWorkbook  createSpreadsheet(View  view)  throws  NotesException  {  
      HSSFWorkbook  workbook  =  new  HSSFWorkbook();  
      HSSFSheet  sheet  =  workbook.createSheet(view.getName());  
      ViewEntryCollection  vc  =  view.getAllEntries();  
      for  (ViewEntry  ve  =  vc.getFirstEntry();  ve  !=  null;  ve  =  vc.getNextEntry())  {  
         HSSFRow  row  =  sheet.createRow(  sheet.getPhysicalNumberOfRows()  );  
         for  (int  i  =  0;  i  <  ve.getColumnValues().size();  i++)  {  
            row.createCell(i).setCellValue(ve.getColumnValues().get(i).toString());  
         }  
      }  
      return  workbook;  
   }
Export XAgent
▪ Import different jar
importPackage(org.apache.poi.hssf.usermodel);  
▪ Call the Java code
var  wb:HSSFWorkbook  =  new  HSSFWorkbook();  
▪ HTTP header stuff so the browser knows it’s a spreadsheet
pageResponse.setContentType("application/x-­‐ms-­‐excel");  
pageResponse.setHeader("Content-­‐Disposition","inline;  filename="  +  
fileName);  
▪ Send bytes instead of text
wb.write(pageResponse.getOutputStream());
POTENTIAL PROBLEMS
Security and access and memory
User Access versus Signer Access on XPages
▪ Pretty much just like you’d expect
- If users can’t access certain records, they still can’t access certain records
- The Notes Security model is the same

▪ Use ExtLibUtil.getCurrentSessionAsSigner() to get SessionAsSigner

▪ XPages security in general:
- http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPages_in_the_Notes_Client-Security
java.policy File
▪ The dreaded java.lang.SecurityException and java.security.AccessControlException

▪ AccessController.doPrivileged(newPrivilegedAction() { code here } )
- http://lekkimworld.com/mView.action?entry=1371725987318
- Tricky, has to be called from a JAR in /ext or an OSGi bundle (read the whole article)

▪ Julian’s article on java.policy:
- http://www.socialbizug.org/blogs/2ec5d0ed-d04e-4b18-9610-9819fcebca79/entry/
the_java_policy_file_in_ibm_domino?lang=en_us
Memory Errors
▪ notes.ini variable: HTTPJVMMaxHeapSize

▪ Make sure you are using a 64-bit version of the Domino server
- “show server” at the Domino console should say “(64 bit)” for Windows

▪ Helpful links
- http://www-10.lotus.com/ldd/dominowiki.nsf/dx/HTTPJVM_Out_of_memory
- http://www.xpageswiki.com/web/youatnotes/wiki-xpages.nsf/dx/
Memory_Usage_and_Performance
Engage Online
▪ SocialBiz User Group socialbizug.org
- Join the epicenter of Notes and Collaboration user groups
▪ Social Business Insights blog ibm.com/blogs/socialbusiness
- Read and engage with our bloggers
▪ Follow us on Twitter
- @IBMConnect and @IBMSocialBiz
▪ LinkedIn http://bit.ly/SBComm
- Participate in the IBM Social Business group on LinkedIn
▪ Facebook https://www.facebook.com/IBMConnected
- Like IBM Social Business on Facebook
Notices and Disclaimers
Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional
technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT
SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF
OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they
may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational
purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory
requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will
ensure that the customer is in compliance with any law.
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this
publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES,
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.
IBM, the IBM logo, ibm.com, BrassRing®, Connections™, Domino®, Global Business Services®, Global Technology Services®, SmartCloud®, Social Business®, Kenexa®, Notes®, PartnerWorld®, Prove It!®,
PureSystems®, Sametime®, Verse™, Watson™, WebSphere®, Worklight®, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names
might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
THANK YOU
Julian Robichaux
jrobichaux@panagenda.com
http://panagenda.com
Kathy Brown
kathy@runningnotes.net
http://runningnotes.net
Ad

More Related Content

What's hot (19)

How do event loops work in Python?
How do event loops work in Python?How do event loops work in Python?
How do event loops work in Python?
Saúl Ibarra Corretgé
 
15network Programming Clients
15network Programming Clients15network Programming Clients
15network Programming Clients
Adil Jafri
 
Java I/O
Java I/OJava I/O
Java I/O
Jussi Pohjolainen
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
Krasimir Berov (Красимир Беров)
 
Java Networking
Java NetworkingJava Networking
Java Networking
Ankit Desai
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)
N Masahiro
 
XPath for web scraping
XPath for web scrapingXPath for web scraping
XPath for web scraping
Scrapinghub
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server Internals
Praveen Gollakota
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
Eduardo Bergavera
 
Files & IO in Java
Files & IO in JavaFiles & IO in Java
Files & IO in Java
CIB Egypt
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
June Blender
 
Python, do you even async?
Python, do you even async?Python, do you even async?
Python, do you even async?
Saúl Ibarra Corretgé
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
Hamid Ghorbani
 
Apache Thrift
Apache ThriftApache Thrift
Apache Thrift
knight1128
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
Ryan Riley
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11
Elizabeth Smith
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guide
Tobias Schlitt
 
Java Networking
Java NetworkingJava Networking
Java Networking
Sunil OS
 
15network Programming Clients
15network Programming Clients15network Programming Clients
15network Programming Clients
Adil Jafri
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)
N Masahiro
 
XPath for web scraping
XPath for web scrapingXPath for web scraping
XPath for web scraping
Scrapinghub
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server Internals
Praveen Gollakota
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
Eduardo Bergavera
 
Files & IO in Java
Files & IO in JavaFiles & IO in Java
Files & IO in Java
CIB Egypt
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
June Blender
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
Ryan Riley
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11
Elizabeth Smith
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guide
Tobias Schlitt
 
Java Networking
Java NetworkingJava Networking
Java Networking
Sunil OS
 

Viewers also liked (19)

XPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and MoreXPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and More
Teamstudio
 
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
Gavin Bollard
 
How to share a File using IBM Connections.Cloud
How to share a File using IBM Connections.CloudHow to share a File using IBM Connections.Cloud
How to share a File using IBM Connections.Cloud
Gavin Bollard
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
Mark Leusink
 
XPages and Java (DanNotes 50th conference, November 2013)
XPages and Java (DanNotes 50th conference, November 2013)XPages and Java (DanNotes 50th conference, November 2013)
XPages and Java (DanNotes 50th conference, November 2013)
Per Henrik Lausten
 
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And TomorrowAD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
pjanzen11
 
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
Stephan H. Wissel
 
Java for XPages Development
Java for XPages DevelopmentJava for XPages Development
Java for XPages Development
Teamstudio
 
xe:objectData
xe:objectDataxe:objectData
xe:objectData
Thimo Jansen
 
IBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivityIBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivity
SocialBiz UserGroup
 
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile FirstBP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
John Head
 
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTFIBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
Niklas Heidloff
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
Aveedo - Your application framework
Aveedo - Your application frameworkAveedo - Your application framework
Aveedo - Your application framework
We4IT Group
 
Entwicklercamp responive web design
Entwicklercamp   responive web designEntwicklercamp   responive web design
Entwicklercamp responive web design
Henning Schmidt
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
Paul Fiore
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
Teamstudio
 
Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13
Dominopoint - Italian Lotus User Group
 
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
Serdar Basegmez
 
XPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and MoreXPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and More
Teamstudio
 
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
How to upload a file to an IBM Connections.Cloud Community using the Plugins ...
Gavin Bollard
 
How to share a File using IBM Connections.Cloud
How to share a File using IBM Connections.CloudHow to share a File using IBM Connections.Cloud
How to share a File using IBM Connections.Cloud
Gavin Bollard
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
Mark Leusink
 
XPages and Java (DanNotes 50th conference, November 2013)
XPages and Java (DanNotes 50th conference, November 2013)XPages and Java (DanNotes 50th conference, November 2013)
XPages and Java (DanNotes 50th conference, November 2013)
Per Henrik Lausten
 
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And TomorrowAD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
pjanzen11
 
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
Stephan H. Wissel
 
Java for XPages Development
Java for XPages DevelopmentJava for XPages Development
Java for XPages Development
Teamstudio
 
IBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivityIBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivity
SocialBiz UserGroup
 
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile FirstBP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
BP110: The Mobile Distruption - Why XPages Development is targeting Mobile First
John Head
 
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTFIBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
IBM Collaboration Solutions Community Meeting 11/11 - OpenNTF
Niklas Heidloff
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
Aveedo - Your application framework
Aveedo - Your application frameworkAveedo - Your application framework
Aveedo - Your application framework
We4IT Group
 
Entwicklercamp responive web design
Entwicklercamp   responive web designEntwicklercamp   responive web design
Entwicklercamp responive web design
Henning Schmidt
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
Paul Fiore
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
Teamstudio
 
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
Serdar Basegmez
 
Ad

Similar to BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal Code (20)

node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
Best Of Jdk 7
Best Of Jdk 7Best Of Jdk 7
Best Of Jdk 7
Kaniska Mandal
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/Multitasking
Sasha Kravchuk
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3
Bradley Holt
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
Akshay Nagpurkar
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
Akshay Nagpurkar
 
Xml Java
Xml JavaXml Java
Xml Java
cbee48
 
NodeJS
NodeJSNodeJS
NodeJS
LinkMe Srl
 
Intro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data IntegrationIntro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data Integration
Philip Yurchuk
 
JAVA MULTITHREDED PROGRAMMING - LECTURES
JAVA MULTITHREDED PROGRAMMING - LECTURESJAVA MULTITHREDED PROGRAMMING - LECTURES
JAVA MULTITHREDED PROGRAMMING - LECTURES
rm170484
 
55j7
55j755j7
55j7
swein2
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Su Zin Kyaw
 
JDK1.7 features
JDK1.7 featuresJDK1.7 features
JDK1.7 features
india_mani
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
Deniz Oguz
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
Geert Van Pamel
 
A Scalable I/O Manager for GHC
A Scalable I/O Manager for GHCA Scalable I/O Manager for GHC
A Scalable I/O Manager for GHC
Johan Tibell
 
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
jaxconf
 
The Play Framework at LinkedIn
The Play Framework at LinkedInThe Play Framework at LinkedIn
The Play Framework at LinkedIn
Yevgeniy Brikman
 
A java servers
A java serversA java servers
A java servers
vibrantuser
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
Leandro Coutinho
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/Multitasking
Sasha Kravchuk
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3
Bradley Holt
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
Akshay Nagpurkar
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
Akshay Nagpurkar
 
Xml Java
Xml JavaXml Java
Xml Java
cbee48
 
Intro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data IntegrationIntro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data Integration
Philip Yurchuk
 
JAVA MULTITHREDED PROGRAMMING - LECTURES
JAVA MULTITHREDED PROGRAMMING - LECTURESJAVA MULTITHREDED PROGRAMMING - LECTURES
JAVA MULTITHREDED PROGRAMMING - LECTURES
rm170484
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Su Zin Kyaw
 
JDK1.7 features
JDK1.7 featuresJDK1.7 features
JDK1.7 features
india_mani
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
Deniz Oguz
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
Geert Van Pamel
 
A Scalable I/O Manager for GHC
A Scalable I/O Manager for GHCA Scalable I/O Manager for GHC
A Scalable I/O Manager for GHC
Johan Tibell
 
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
jaxconf
 
The Play Framework at LinkedIn
The Play Framework at LinkedInThe Play Framework at LinkedIn
The Play Framework at LinkedIn
Yevgeniy Brikman
 
Ad

More from panagenda (20)

HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Getting the Best of TrueDEM – April News & Updates
Getting the Best of TrueDEM – April News & UpdatesGetting the Best of TrueDEM – April News & Updates
Getting the Best of TrueDEM – April News & Updates
panagenda
 
Teams Call Records: Treasure Trove or Pandora’s Box?
Teams Call Records: Treasure Trove or Pandora’s Box?Teams Call Records: Treasure Trove or Pandora’s Box?
Teams Call Records: Treasure Trove or Pandora’s Box?
panagenda
 
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
panagenda
 
New Teams Client Architecture Autopsy, a Look Under the Hood
New Teams Client Architecture Autopsy, a Look Under the HoodNew Teams Client Architecture Autopsy, a Look Under the Hood
New Teams Client Architecture Autopsy, a Look Under the Hood
panagenda
 
Architektur des neuen Teams Clients – Ein Blick unter die Haube
Architektur des neuen Teams Clients – Ein Blick unter die HaubeArchitektur des neuen Teams Clients – Ein Blick unter die Haube
Architektur des neuen Teams Clients – Ein Blick unter die Haube
panagenda
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
panagenda
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdfDe05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
panagenda
 
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
panagenda
 
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
panagenda
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
panagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
panagenda
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
panagenda
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
panagenda
 
Why you need monitoring to keep your Microsoft 365 journey successful
Why you need monitoring to keep your Microsoft 365 journey successfulWhy you need monitoring to keep your Microsoft 365 journey successful
Why you need monitoring to keep your Microsoft 365 journey successful
panagenda
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Getting the Best of TrueDEM – April News & Updates
Getting the Best of TrueDEM – April News & UpdatesGetting the Best of TrueDEM – April News & Updates
Getting the Best of TrueDEM – April News & Updates
panagenda
 
Teams Call Records: Treasure Trove or Pandora’s Box?
Teams Call Records: Treasure Trove or Pandora’s Box?Teams Call Records: Treasure Trove or Pandora’s Box?
Teams Call Records: Treasure Trove or Pandora’s Box?
panagenda
 
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
Teams Call Records: Eine Schatztruhe oder die Büchse der Pandora?
panagenda
 
New Teams Client Architecture Autopsy, a Look Under the Hood
New Teams Client Architecture Autopsy, a Look Under the HoodNew Teams Client Architecture Autopsy, a Look Under the Hood
New Teams Client Architecture Autopsy, a Look Under the Hood
panagenda
 
Architektur des neuen Teams Clients – Ein Blick unter die Haube
Architektur des neuen Teams Clients – Ein Blick unter die HaubeArchitektur des neuen Teams Clients – Ein Blick unter die Haube
Architektur des neuen Teams Clients – Ein Blick unter die Haube
panagenda
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
panagenda
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdfDe05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
De05_panagenda_Prepare-Applications-for-64-bit-Clients.pdf
panagenda
 
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
Co01_panagenda_NotesDomino-Licensing-Understand-and-Optimize-DLAU-results-wit...
panagenda
 
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
Ad01_Navigating-HCL-Notes-14-Upgrades_A-Comprehensive-Guide-for-Conquering-Ch...
panagenda
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
panagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
panagenda
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
panagenda
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
panagenda
 
Why you need monitoring to keep your Microsoft 365 journey successful
Why you need monitoring to keep your Microsoft 365 journey successfulWhy you need monitoring to keep your Microsoft 365 journey successful
Why you need monitoring to keep your Microsoft 365 journey successful
panagenda
 

Recently uploaded (20)

Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 

BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal Code

  • 1. BP107: Ten Lines Or Less Interesting Things You Can Do In Java With Minimal Code Julian Robichaux, panagenda Kathy Brown, PSC Group
  • 2. Why are we here? ▪ Java snippets for IBM Notes® and Domino® - 10 lines or less - beginner-to-intermediate level stuff - hopefully useful ▪ Integration tips - XPages only - Gotchas ▪ Sample database - http://www.runningnotes.net and/or http://nsftools.com/blog
  • 3. The 10-Line Rules Rule #1 The method signature is not part of the line count   public  String  getFoo()  {       return  "foo";     } This only counts as one line
  • 4. The 10-Line Rules Rule #2 A single line with linefeeds added for readability is still just one line   public  String  getFoos()  {       return  "foo"  +                "foo"  +                "foofoofoo";     } This only counts as one line
  • 5. The 10-Line Rules Rule #3 We make the rules   public  String  getFoot()  {       Foot  foot  =  new  Foot();       foot.addToes(12).makeHairy();       return  foot.toString();     } This is as many lines as we say it is
  • 6. The 10-Line Rules Rule #4 Error handling and object cleanup has sometimes been omitted for brevity PLEASE use good error handling in your production code
  • 7. About the Sample Application ▪ As you travel, you can upload pictures from your smartphone to this app ▪ Upon upload, the app will: - Read GPS data from the picture - Use a web service to obtain the address - Create a thumbnail of the photo - Embed the thumbnail into a rich text field ▪ Other functionality: - Return info as JSON - Return info as a spreadsheet - FTP to a server
  • 8. GETTING STARTED The basics. Where does this stuff go? How do we access Notes objects?
  • 9. Where does our Java code live? ▪ How to add Java design elements to Code > Java and Code > Jars - Jars can be copy/pasted, or dragged/dropped, or “Import Jar” - Java classes can be copy/pasted, dragged/dropped, or “Create New Class”
 ▪ What’s the difference? - A Jar (Java ARchive) file is a file containing one or more Java classes
  • 10. Where does our Java code live? ▪ NOTE: XPages only, agents are different - Agents don’t have access to Java design elements
 ▪ Just code for now, we’ll tackle external libraries later
 ▪ Java code can also go in WebContent/WEB-INF/lib or on the host system - Paul Calhoun and Paul Della-Nebbia have several slides on benefits of each location in their Java Jumpstart, http://www.slideshare.net/Teamstudio/java-for-xpages-development
  • 11. Java 1.5 ▪ IBM Notes/Domino 8.5 and 9.0 uses Java 1.6 as a JVM ▪ Java design elements (for XPages) compile to version 1.5 by default - Enhanced for loops - Auto-boxing - Enums - Generics ▪ Java agents compile to version 1.2 by default - Can be changed with notes.ini variable: JavaCompilerTarget - Agents might not run on older clients or servers
  • 12. Example: Getting Document Attachments [1]   public  EmbeddedObject  getFirstDocAttachment(Document  doc)               throws  NotesException  {       Session  session  =  doc.getParentDatabase().getParent();       Vector  atts  =  session.evaluate("@AttachmentNames",  doc);       String  firstFile  =  (String)atts.get(0);       if  (firstFile.length()  >  0)  {         EmbeddedObject  eo  =  doc.getAttachment(firstFile);         return  eo;       }       return  null;     } Here’s one way to get a Notes Session Everything else is pretty much like LotusScript
  • 13. Example: Getting Document Attachments [2]   public  EmbeddedObject  getFirstRichTextAttachment(RichTextItem  rtItem)             throws  NotesException  {       Vector  atts  =  rtItem.getEmbeddedObjects();       for  (Iterator  iterator  =  atts.iterator();  iterator.hasNext();)  {         EmbeddedObject  eo  =  (EmbeddedObject)  iterator.next();         if  (eo.getType()  ==  EmbeddedObject.EMBED_ATTACHMENT)  {           return  eo;         }       }       return  null;     } Notes API still uses Vectors quite often as return objects Iterator loop, in case you want to use this in an agent
  • 14. Passing Current Document and Calling Java importPackage(com.lotusphere.bp107_2015);   var  doc:NotesDocument  =  currentDocument.getDocument();   var  eo:lotus.domino.EmbeddedObject  =  TenLinesOrLess.getFirstDocAttachment(doc) public  static  EmbeddedObject  getFirstDocAttachment(Document  doc)   throws  NotesException  {       Session  session  =  doc.getParentDatabase().getParent();       Vector  atts  =  session.evaluate("@AttachmentNames",  doc);       String  firstFile  =  (String)atts.get(0);       if  (firstFile.length()  >  0)  {         EmbeddedObject  eo  =  doc.getAttachment(firstFile);         return  eo;       }       return  null;     } JavaScript Java
  • 15. WORKING WITH FILES Reading, writing, and accessing files. Permissions, considerations, and working with byte arrays directly.
  • 16. Basic File IO ▪ Java keeps improving file IO classes - Java 1.5 added Closable interfaces - Java 1.7 added java.nio.file classes (“Files” is especially useful) - http://docs.oracle.com/javase/tutorial/essential/io/legacy.html 
 ▪ By default, Notes/Domino Java elements compile to Java 1.5 compatible code - You can change to 1.6 in project properties, but this might break things - No significant java.io changes in 1.6 anyway: 
 http://docs.oracle.com/javase/6/docs/technotes/guides/io/enhancements.html
  • 17. Example: Reading a Text File into a String [1]   public  String  readTextFileScanner(String  fileName)  throws  IOException  {       //  Scanner  can  be  flaky  about  sometimes  not  returning  all  the  data,         //  and  can  be  slower  because  it's  using  regex  internally       StringBuilder  text  =  new  StringBuilder();       String  crlf  =  System.getProperty("line.separator");       Scanner  scanner  =  new  Scanner(new  FileInputStream(fileName),  "UTF-­‐8");       while  (scanner.hasNextLine()){         text.append(scanner.nextLine()  +  crlf);       }       scanner.close();       return  text.toString();     } using the right character set is important! Scanner can be flaky on large strings, and you might be replacing n with rn for linefeeds
  • 18. Example: Reading a Text File into a String [2]   public  String  readTextFileReader(String  fileName)  throws  IOException  {       //  StringBuilder  is  faster  than  StringBuffer  because  it's  not       //  synchronized       StringBuilder  sb  =  new  StringBuilder();       BufferedReader  reader  =  new  BufferedReader(           new  InputStreamReader(new  FileInputStream(fileName),  "UTF-­‐8"));       char[]  buffer  =  new  char[1024];       int  size  =  0;       while((size  =  reader.read(buffer))  !=  -­‐1)  {         sb.append(buffer,  0,  size);       }       reader.close();       return  sb.toString();     } again with the character seta tiny bit more work, but slightly faster and probably more reliable
  • 19. Example: Writing a File to Another File [1]   public  void  copyFileChannel(String  fileToRead,  String  fileToWrite)               throws  IOException  {       //  you  should  add  try/finally  blocks  to  make  sure  streams  get  closed       FileInputStream  in  =  new  FileInputStream(fileToRead);       FileOutputStream  out  =  new  FileOutputStream(fileToWrite,  false);       //  FileChannel  is  faster  but  generally  uses  more  memory;  you  can         //  control  this  somewhat  by  using  FileChannel.map()       FileChannel  channel1  =  in.getChannel();       FileChannel  channel2  =  out.getChannel();       channel1.transferTo(0,  channel1.size(),  channel2);       //  closing  the  streams  also  closes  the  channels       in.close();       out.close();     } FileChannel is fast but uses more memory. You can use memory mapping (and more code) for better control.
  • 20. Example: Writing a File to Another File [2]   public  void  copyFileStream(String  fileToRead,  String  fileToWrite)               throws  IOException  {       //  you  should  add  try/finally  blocks  to  make  sure  streams  get  closed       FileInputStream  in  =  new  FileInputStream(fileToRead);       FileOutputStream  out  =  new  FileOutputStream(fileToWrite,  false);       byte[]  buffer  =  new  byte[1024];       int  size  =  0;       while((size  =  in.read(buffer))  !=  -­‐1)  {         out.write(buffer,  0,  size);       }       in.close();       out.close();     } Two extra lines of code, but easier to stay in a smaller memory footprint
  • 21. Domino Server Permissions for File (and Network) Access ▪ Server doc, security fields - EITHER: Unrestricted Methods - OR: Sign XPages AND Run Restricted
 ▪ Dangers of reading/writing files directly to the server - No delete access? - Forgetting to delete - File contention - Angry admins
  • 22. Working Directly with Byte Arrays ▪ In some cases, we can work directly with byte arrays - Potentially avoid file IO and/or restrictions entirely
 ▪ Memory considerations - It’s expensive to hold an entire file in memory - Info and a few links about memory at the end of the presentation
  • 23. Example: Accessing Embedded Objects [1]       EmbeddedObject  eo  =  getFirstDocAttachment(doc);         File  tempFile  =  File.createTempFile("eo-­‐",  ".tmp");         eo.extractFile(tempFile.getAbsolutePath()); After you’re done with the file, you are responsible for deleting it Easy way to create a temp file in the temp folder
  • 24. Example: Accessing Embedded Objects [2]       EmbeddedObject  eo  =  getFirstDocAttachment(doc);         InputStream  in  =  new  BufferedInputStream(eo.getInputStream()); After you’re done with the InputStream, you are responsible for closing it This actually creates a temp file in the background BufferedInputStream supports mark/reset (and it sometimes speeds things up)
  • 25. EmbeddedObject Temp Files ▪ If your temp directory looks like this, EmbeddedObject.getInputStream() is the culprit - Check your code for Exceptions or missing/misplaced InputStream.close()
  • 26. Create a Thumbnail and Embed the Image ▪ Steps: - Get the file attachment as an InputStream however you want - Resize the image using Java ImageIO - Re-attach the image to a rich text field
 ▪ We will use a super-special magic technique to attach the image as an embedded image instead of a file attachment
 ▪ NOTE: Julian went into more detail about image resizing in a presentation with Mark Myers last year: - http://www.slideshare.net/panagenda/show104-practical-java-30838547
  • 27. Example: Create the Thumbnail Image   public  byte[]  createThumbnail(InputStream  in,  float  size)             throws  IOException  {       BufferedImage  bi  =  ImageIO.read(in);       float  scale  =  Math.min(size/bi.getHeight(),  size/bi.getWidth());       BufferedImage  thumb  =  new  BufferedImage(bi.getWidth(),             bi.getHeight(),  bi.getType());       AffineTransformOp  op  =  new  AffineTransformOp             (AffineTransform.getScaleInstance(scale,  scale),               AffineTransformOp.TYPE_BICUBIC);       thumb  =  op.filter(bi,  thumb);       thumb  =  thumb.getSubimage(0,  0,               (int)(bi.getWidth()*scale),  (int)(bi.getHeight()*scale));       ByteArrayOutputStream  baos  =  new  ByteArrayOutputStream();       ImageIO.write(thumb,  "jpg",  baos);       return  baos.toByteArray();     } InputStream from an EmbeddedObject or file ByteArrayOutputStreams are handy
  • 28. Example: Create the Embedded Image in a MIME Field   public  void  embedImageMIME(Document  doc,  String  fieldName,               byte[]  imageData,  String  mimeType,  String  fileName)               throws  NotesException  {       MIMEEntity  mime  =  doc.createMIMEEntity(fieldName);       MIMEHeader  hdr  =  mime.createHeader("MIME-­‐Version");       hdr.setHeaderValAndParams("1.0");       Session  session  =  doc.getParentDatabase().getParent();       Stream  stream  =  session.createStream();       stream.write(imageData);       //  NOTE:  JPG  images  must  be  MIME  type  "image/jpeg",  not  "image/jpg"       mime.setContentFromBytes(stream,             mimeType  +  ";  name=""  +  fileName  +  """,             MIMEEntity.ENC_IDENTITY_BINARY);       doc.closeMIMEEntities(true,  fieldName);     } you just have to add the data to the MIME field like this
  • 29. Example: Create the Embedded Image in a Rich Text Field   public  void  embedImageRichText(RichTextItem  rtitem,               byte[]  imageData,  String  mimeType,  String  fileName)               throws  NotesException  {       Database  db  =  rtitem.getParent().getParentDatabase();       Session  session  =  db.getParent();       Document  tempDoc  =  db.createDocument();       //  for  non-­‐image  MIME  types,  this  will  just  be  an  attachment       embedImageMIME(tempDoc,  "body",  imageData,  mimeType,  fileName);       boolean  isConvert  =  session.isConvertMime();       session.setConvertMime(true);       RichTextItem  tempItem  =  (RichTextItem)tempDoc.getFirstItem("body");       session.setConvertMime(isConvert);       rtitem.appendRTItem(tempItem);       tempDoc.recycle();     } setConvertMime is what changes the MIME data to an embedded image
  • 30. THIRD PARTY LIBRARIES Options for adding and using third party libraries.
  • 31. How to Add Third Party Libraries ▪ You can add them just like we did with our “own” code - Drag/drop, copy/paste, import, etc. into Jars, Java or WebContent - Sometimes the build path gets lost • In Package Explorer, right-click, Build Path > Configure Build Path
 ▪ You can create/use an OSGi plugin - Here are some tutorials: • http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Creating_an_XPages_Library • http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Deploying_XPage_Libraries
  • 32. How to Add Third Party Libraries ▪ You can put the JAR files in the /jvm/lib/ext directory - Has to be on all servers the app is on - Painful to make updates - Admins don’t like this
 ▪ Security - Third party code is, well, third party, so use code from trusted sources, like apache.org - Might require changes to java.policy or similar
  • 33. metadata-extractor Library ▪ Open-source (Apache 2) library for reading EXIF data from photo files - https://drewnoakes.com/code/exif/index.html - https://github.com/drewnoakes/metadata-extractor/releases - http://javadoc.metadata-extractor.googlecode.com/git/2.7.0/index.html 
 ▪ Time/date, GPS, camera type, exposure, etc.
  • 34. Example: Get GPS Data from a Photo   public  double[]  getLatLong(InputStream  in)               throws  IOException,  ImageProcessingException  {       Metadata  metadata  =  ImageMetadataReader.readMetadata(in);       GpsDirectory  gpsDir  =               (GpsDirectory)metadata.getDirectory(GpsDirectory.class);       if  (gpsDir  !=  null)  {         GeoLocation  gps  =  gpsDir.getGeoLocation();         double[]  latLong  =               new  double[]{  gps.getLatitude(),  gps.getLongitude()  };         return  latLong;       }       return  null;     } Easy way to populate an array
  • 35. Generating Barcodes and QR Codes ▪ ZXing library - https://github.com/zxing/zxing - Java and several other languages - Open source, Apache 2.0 licensed
 ▪ Create several different types of 1D and 2D barcodes - UPC, EAN, Code 128, QR Code, etc.
  • 36. Example: Create a QR Code   public  byte[]  createQrCode(String  text,  int  size)               throws  IOException,  WriterException  {       String  charset  =  "ISO-­‐8859-­‐1";       Hashtable  hints  =  new  Hashtable();       hints.put(EncodeHintType.CHARACTER_SET,  charset);             MultiFormatWriter  qwriter  =  new  MultiFormatWriter();       BitMatrix  qbits  =  qwriter.encode(text,  BarcodeFormat.QR_CODE,               size,  size,  hints);       ByteArrayOutputStream  out  =  new  ByteArrayOutputStream();       MatrixToImageWriter.writeToStream(qbits,  "png",  out);       return  out.toByteArray();     } You could also write directly to a file, embed this as an image, etc. ISO-8859-1 is preferred for QRCode text
  • 37. ACCESSING WEB SITES Making an HTTP connection, getting data, parsing XML
  • 38. Connecting to External Websites ▪ URL classes (HTTP and HTTPS) are built-in to Java - Apache HttpComponents are good if you need more fine-grained control - http://hc.apache.org 
 ▪ Same security requirements as file access (see earlier slides)
 ▪ Additional steps required for proxy servers - and possibly HTTPS, if certificates are not allowed

  • 39. Maps, Addresses, and Geocoding ▪ Many online mapping services available ▪ Be mindful of license restrictions and requirements - Sometimes the free services aren’t free at all - Especially if you’re a corporation ▪ OpenStreetMap is an open-source alternative - License: http://www.openstreetmap.org/copyright - Maps API: http://wiki.openstreetmap.org/wiki/Develop - Geocoding: http://wiki.openstreetmap.org/wiki/Nominatim - Usage Policy: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
  • 40. Example: Convert GPS Coordinates to Address (reverse geocoding)   public  String  getAddress(double  latitude,  double  longitude)  throws  IOException  {       URL  url  =  new  URL("http://nominatim.openstreetmap.org/reverse?format=xml"  +             "&lat="  +  latitude  +  "&lon="  +  longitude  +  "&zoom=18&addressdetails=1");       InputStream  in  =  url.openStream();             try  {         DocumentBuilderFactory  factory  =  DocumentBuilderFactory.newInstance();         factory.setValidating(false);         org.w3c.dom.Document  domDoc  =  factory.newDocumentBuilder().parse(in);         Node    node  =  XPathAPI.selectSingleNode(domDoc,                 "/reversegeocode/result/text()");         return  node.getNodeValue();       }  catch  (Exception  ignored)  {  in.close();  }       return  null;     } Make sure it’s “org.w3c.dom.Document” and not lotus.domino.Document Weirdly, this closes the InputStream after parsing
  • 41. XML and XPath ▪ After your XML data has been parsed, you can: - Step through the nodes to look for data (boring) - Use XPath to search and extract specific nodes (fun!)
 ▪ XPath is a kind of query language for searching through XML - Also used with XSL
 ▪ Getting started - http://en.wikibooks.org/wiki/XPath/Basic_Syntax - http://www.ibm.com/developerworks/xml/tutorials/x-xpath/x-xpath.html
  • 42. OpenStreetMap Output and XPath <?xml version="1.0" encoding="UTF-8"?> <reversegeocode querystring="format=xml&amp;lat=51.46483333333333&amp;lon=-3.164&amp;zoom=18&amp;addressdetails=1" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" timestamp="Fri, 02 Jan 15 18:12:42 +0000"> <result lon="-3.1632088647976" lat="51.46474055" ref="Wales Millennium Centre" osm_id="26584146" osm_type="way" place_id="60125628">Wales Millennium Centre, Roald Dahl Plass, Cardiff Bay, Cardiff, Wales, CF10 5AN, United Kingdom</result> <addressparts> <theatre>Wales Millennium Centre</theatre> <pedestrian>Roald Dahl Plass</pedestrian> <suburb>Cardiff Bay</suburb> <city>Cardiff</city> <county>Cardiff</county> <state>Wales</state> <postcode>CF10 5AN</postcode> <country>United Kingdom</country> <country_code>gb</country_code> </addressparts> </reversegeocode>    Node  node  =  XPathAPI.selectSingleNode(domDoc,         "/reversegeocode/result/text()");
  • 43. FTP ▪ For FTP, an easy (and small) library to use is Apache Commons Net - http://commons.apache.org/proper/commons-net/index.html 
 ▪ Also supports FTPS, TFTP, and a few other protocols
 ▪ SFTP is different - try http://www.jcraft.com/jsch
  • 44. Example: Upload a File via FTP   public  boolean  uploadFtpFile(String  server,  String  ftpFilePath,           InputStream  stream)  throws  IOException  {       boolean  result  =  false;       FTPClient  ftp  =  new  FTPClient();       ftp.connect(server);       if  (FTPReply.isPositiveCompletion(  ftp.getReplyCode()  ))  {         if  (ftp.login("anonymous",  "[email protected]"))  {           ftp.setFileType(FTP.BINARY_FILE_TYPE);           result  =  ftp.storeFile(ftpFilePath,  stream);         }         ftp.disconnect();       }       return  result;     } ftpFilePath like “file.doc” or “/subdir/file.doc” this will fail if ftpFilePath refers to a subdir that doesn’t exist, or if the file already exists and you don’t have delete rights
  • 45. Create a Button on the XPage to upload the attached photo via FTP <xp:button  value="FTP  File"  id="button3"  refreshMode="complete">       <xp:eventHandler  event="onclick"  submit="true"  refreshMode="complete">         <xp:this.action><![CDATA[#{javascript:try  {   importPackage(com.lotusphere.bp107_2015);   var  doc:lotus.domino.Document  =  currentDocument.getDocument(true);   var  eo:lotus.domino.EmbeddedObject  =  TenLinesOrLess.getFirstDocAttachment(doc);   var  stream:java.io.InputStream  =  eo.getInputStream();   var  streamIsOpen  =  true;   TenLinesOrLess.uploadFtpFile("ftp.tardis.who",  "/ftp/important.txt",  stream);   }  catch(e)  {   _dump(e);   }  finally  {   if  (streamIsOpen)  {   stream.close();   }}}]]></xp:this.action></xp:eventHandler></xp:button>
  • 46. XAGENTS AND OUTPUT Using XAgents, collecting data, creating JSON, creating a spreadsheet, sending info to the browser
  • 47. What is an XAgent? ▪ What is it? - An XPage that is not rendered, but can return JSON or XML or other data (like an agent does) for use in charting, grids, exporting data, and more
 ▪ How do you create one? It’s as easy as 1-2-3 - We will show two examples, returning JSON and returning an Excel file • Step one - create an XPage • Step two - set rendered=“false” • Step three - add some code to return some data
  • 48. JSON in Java ▪ No native JSON support in Java (until maybe Java 9), must use third-party libraries ▪ Lots of popular options - gson, jackson, etc. - see the list at json.org ▪ Libraries that use reflection to create JSON from Objects are nice, but they generally cause AccessControlExceptions with IBM Domino because they use reflection - and they’re relatively large if you just want to create a JSON string ▪ json-simple is a nice, small (simple) choice - http://code.google.com/p/json-simple
  • 49. Example: Creating JSON   public  String  createJson()  {       HashMap  values  =  new  LinkedHashMap();       values.put("value1",  "one");       values.put("value2",  2);             HashMap  subValues  =  new  LinkedHashMap();       subValues.put("subValue1",  new  Date());       subValues.put("subValue2",  System.currentTimeMillis());       values.put("value3",  subValues);             return  JSONObject.toJSONString(values);     } HashMaps are awesome, and LinkedHashMap retains order You can put Maps inside of Maps Java 1.5 auto-boxing lets us use int instead of Integer
  • 50. The JSON XAgent <xp:view xmlns:xp=“http://www.ibm.com/xsp/core" rendered="false"> <xp:this.afterRenderResponse> <![CDATA[#{javascript: importPackage(java.lang); importPackage(com.lotusphere.bp107_2015); var myview:lotus.domino.View = database.getView("travelogvw"); var json = TenLinesOrLess.createJson(myview); var externalContext = facesContext.getExternalContext(); var writer = facesContext.getResponseWriter(); var response = externalContext.getResponse(); response.setContentType("application/json"); response.setHeader("Cache-Control", "no-cache"); writer.write(json); writer.endDocument() }]]></xp:this.afterRenderResponse></xp:view> Call the Java code JavaScript for the XAgent Send the data Set the HTTP header Don’t render the XPage
  • 51. Spreadsheets and Apache POI ▪ The go-to Java library for generating Excel spreadsheets is Apache POI - http://poi.apache.org
 ▪ There are already a LOT of examples on how to use POI with XPages - Please use your preferred search engine to discover them, we won’t play favorites
 ▪ But, can we create a spreadsheet with 10 lines or less…?
  • 52. Example: Create a Spreadsheet with Apache POI   public  HSSFWorkbook  createSpreadsheet(View  view)  throws  NotesException  {       HSSFWorkbook  workbook  =  new  HSSFWorkbook();       HSSFSheet  sheet  =  workbook.createSheet(view.getName());       ViewEntryCollection  vc  =  view.getAllEntries();       for  (ViewEntry  ve  =  vc.getFirstEntry();  ve  !=  null;  ve  =  vc.getNextEntry())  {         HSSFRow  row  =  sheet.createRow(  sheet.getPhysicalNumberOfRows()  );         for  (int  i  =  0;  i  <  ve.getColumnValues().size();  i++)  {           row.createCell(i).setCellValue(ve.getColumnValues().get(i).toString());         }       }       return  workbook;     }
  • 53. Export XAgent ▪ Import different jar importPackage(org.apache.poi.hssf.usermodel);   ▪ Call the Java code var  wb:HSSFWorkbook  =  new  HSSFWorkbook();   ▪ HTTP header stuff so the browser knows it’s a spreadsheet pageResponse.setContentType("application/x-­‐ms-­‐excel");   pageResponse.setHeader("Content-­‐Disposition","inline;  filename="  +   fileName);   ▪ Send bytes instead of text wb.write(pageResponse.getOutputStream());
  • 54. POTENTIAL PROBLEMS Security and access and memory
  • 55. User Access versus Signer Access on XPages ▪ Pretty much just like you’d expect - If users can’t access certain records, they still can’t access certain records - The Notes Security model is the same
 ▪ Use ExtLibUtil.getCurrentSessionAsSigner() to get SessionAsSigner
 ▪ XPages security in general: - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPages_in_the_Notes_Client-Security
  • 56. java.policy File ▪ The dreaded java.lang.SecurityException and java.security.AccessControlException
 ▪ AccessController.doPrivileged(newPrivilegedAction() { code here } ) - http://lekkimworld.com/mView.action?entry=1371725987318 - Tricky, has to be called from a JAR in /ext or an OSGi bundle (read the whole article)
 ▪ Julian’s article on java.policy: - http://www.socialbizug.org/blogs/2ec5d0ed-d04e-4b18-9610-9819fcebca79/entry/ the_java_policy_file_in_ibm_domino?lang=en_us
  • 57. Memory Errors ▪ notes.ini variable: HTTPJVMMaxHeapSize
 ▪ Make sure you are using a 64-bit version of the Domino server - “show server” at the Domino console should say “(64 bit)” for Windows
 ▪ Helpful links - http://www-10.lotus.com/ldd/dominowiki.nsf/dx/HTTPJVM_Out_of_memory - http://www.xpageswiki.com/web/youatnotes/wiki-xpages.nsf/dx/ Memory_Usage_and_Performance
  • 58. Engage Online ▪ SocialBiz User Group socialbizug.org - Join the epicenter of Notes and Collaboration user groups ▪ Social Business Insights blog ibm.com/blogs/socialbusiness - Read and engage with our bloggers ▪ Follow us on Twitter - @IBMConnect and @IBMSocialBiz ▪ LinkedIn http://bit.ly/SBComm - Participate in the IBM Social Business group on LinkedIn ▪ Facebook https://www.facebook.com/IBMConnected - Like IBM Social Business on Facebook
  • 59. Notices and Disclaimers Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM. Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided. Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice. Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation. It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right. IBM, the IBM logo, ibm.com, BrassRing®, Connections™, Domino®, Global Business Services®, Global Technology Services®, SmartCloud®, Social Business®, Kenexa®, Notes®, PartnerWorld®, Prove It!®, PureSystems®, Sametime®, Verse™, Watson™, WebSphere®, Worklight®, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.