oranges are not the only fruit (alternative solutions for providing additional functionality in...
TRANSCRIPT
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
September 2012
Presenter: Matthew FylemanCompany: We4IT Group
Alternative Solutions for Providing Additional Functionality in your Xpages Apps
Oranges are not the only fruit
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Agenda•About me•Beyond the borders of OpenNTF:
•Bootstrap alternatives•Charting components•Calendar views•Office integration
•Questions
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
About Me
•Senior Developer and Product Manager for We4IT•Over 22 years as an IBM Domino Developer•Now working almost entirely with Xpages•Film addict!
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Beyond the borders of OpenNTF•OpenNTF is an excellent resource!!!
- but it doesn’t have all the answers•Why would you want to do this?o Solution unavailableo Deployment restrictionso Differentiation
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap AlternativesFoundationhttp://foundation.zurb.com
ForVery nice base style
AgainstHeavyweight
UtilisesSASS, jQuery, Foundation Icon Fonts
FeaturesGrids, UI elements, Customiser
SupportsIE 9+
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap AlternativesPurehttp://purecss.io
ForSuper lightweight
AgainstNo LESS/SASS
UtilisesjQuery
FeaturesGrids, Basic UI elements
SupportsIE 7+
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap AlternativesUIKithttp://getuikit.com/
ForVery simple structureEasy to style
AgainstNot commonly used
UtilisesjQuery
FeaturesGrids, UI elements, Themeroller
SupportsIE 9+
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Foundation
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Pure
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
UIKit
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap Alternatives•Bootstrap4XPages can generally be implemented faster
•By implementing an alternative …• Committing to a little more work• Can achieve a more individual result• Potentially a nicer result (of course subjective)
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap AlternativesWe use UIKit:<script src="js/jquery.min.js"></script><script src="js/uikit.min.js"></script><link rel="stylesheet" href="css/uikit.min.css"><div class="uk-container">
<div class="uk-grid"><div class="uk-width-1-3"></div><div class="uk-width-1-3"></div> <div class="uk-width-1-3"></div>
</div></div>DocType = HTML5
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Bootstrap Alternatives
Demo
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsProjects on OpenNTF use:
jqPlothttp://www.jqplot.com
JFreeCharthttp://www.jfree.org/jfreechart/
dojox.chartinghttp://dojotoolkit.org/reference-guide/1.10/dojox/charting.html
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsAlternativeChart.jshttp://www.chartjs.org
• Dynamic• Responsive• IE9+ and all modern Browsers
Example code:<canvas id="canvas" height="450" width="600"></canvas>var ctx = document.getElementById("canvas").getContext("2d");new Chart(ctx).Line(JSONOBJECT, {responsive: true});
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting Components
Demo 1
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting Components
Dynamically loading values:XAgent for the rest Service:http://openntf.org/XSnippets.nsf/snippet.xsp?id=xagent
JSON – generate with Simple:https://code.google.com/p/json-simple/
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting Components
Demo 2
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsAMD - Loader problemFrom Sven Hasselbach:
“Looks like an AMD loader problem with Dojo & JQM. I have tried out to disable the
Factory scan in a test page and this worked for me. To do this I have added the
following parameters in the xsp.properties:
xsp.client.script.dojo.djConfig=dojo-amd-factory-scan: false
Maybe this can help you with your problems in ND9.”
Three solutions…
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsAMD - Loader problem – Solution 1Change the JavaScript Library:
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsAMD - Loader problem – Solution 2
Change the xsp.properties:
http://xomino.com/2013/05/14/xpages-nd9-dojo-1-8-does-not-work-with-other-amd-loaders-and-the-work-around/
xsp.client.script.dojo.djConfig=dojo-amd-factory-scan: false
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting ComponentsAMD - Loader problemChange the order in which the scripts are loaded:
http://hasselba.ch/blog/?p=1216
Only works if the scripts are consolidated:.
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Charting Components
Demo 3
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Calendar viewsFullCalendarhttp://fullcalendar.io
UtilisesjQuery, moment.js
SupportsIE8+
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Calendar viewsFullCalendarhttp://fullcalendar.io
UtilisesjQuery, moment.js
SupportsIE8+
Sample Code<div id='calendar'></div>$('#calendar').fullCalendar();
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Calendar views
Demo 1
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Calendar views
Dynamically loading values:XAgent for the rest Service:http://openntf.org/XSnippets.nsf/snippet.xsp?id=xagent
JSON – generate with Simple:https://code.google.com/p/json-simple/
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Calendar views
Demo 2
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Office Integrationdocx4jhttp://www.docx4java.org/
For•Still supported and developed, better handling of .docx files•HTML can be included (Rich Text)
Against•No .doc support, exclusively .docx (.pptx, .xlsx)
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Office Integration
Demo
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Office Integration – Problem 1Security exception occurred servicing request for: /demo.xsp - HTTP Code: 403
You need to adjust the java security policy:[notes program]/jvm/lib/security/java.policy
Solution 1: Only for Developers! (and 8.5.x users)grant { permission java.security.AllPermission; };
Solution 2: The better way:grant codeBase "xspnsf://server:0/yourdatabase.nsf/-" {
permission java.security.AllPermission;};
See Stephan Wissel’s blog: http://www.wissel.net/blog/d6plinks/SHWL-8JYAT5
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Office Integration – Problem 2After downloading the file once, the page stops responding
Solution: CSJS:XSP.allowSubmit();
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Questions?
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Thank you!
Attend our next session to win a BB-8 Sphero!:
Today, 13:30, Room 1
Simon Peek - „Need XPages apps fast? Need
apps on Mobile devices? Don’t have XPages
knowledge? We4IT brings you Aveedo!”
UKLUG 2012 – Cardiff, Wales@matthew_fyleman@matthew_fyleman
Matthew FylemanWe4IT Group
email: [email protected] :