Skip to main content
ASK THE XPAGES EXPERTS	

Nov. 17, 2015
Courtney Carter	

@Teamstudio	

Howard Greenberg	

@TLCC	

Paul Della-Nebbia	

@PaulDN	

David Leedy	

@DavidLeedy	

Mike McGarel	

@MMcGarel	

Nathan Freeman	

Red Pill Development
Asking Questions	

Use the “Questions” pane to ask questions.	
  
AboutTeamstudio	

•  Manage, modernize, and mobilize business applications with software and
services from Teamstudio.	

o  Easy-to-use tools for Notes and Domino developers and administrators	

o  Mobilization platform for those who want to mobilize using their own internal resources	

o  Modernization Services to help mobilize applications	

•  1600+ active customers, 53 countries	

•  Offices in US, UK, and Japan
Teamstudio NotesTools	

•  Manage your Notes applications faster, better, and more easily.
Teamstudio Unplugged	

•  Mobile application platform that provides organizations with the capability to extend
their desktop and Web-based applications to mobile devices, giving users access to data
anywhere, anytime, even when they’re offline.	

•  Template applications: Continuity, CustomerView, OneView, Doc Library, Journal,
TeamRoom
Teamstudio XControls	

•  Set of controls for IBM Domino developers working on XPages apps and
Notes app modernization projects	

•  Full support for PC browser-based user interfaces, as well as mobile interfaces
Teamstudio Services	

•  Professional services for modernization, Web enablement, project
management, development, and administration	

–  Modernization Services	

–  Developer Assistance Program	

–  Application Upgrade Analysis	

–  Application Complexity Analysis	

–  Application Usage Auditing
Ask the XPages Experts
1
#XPages
Your Hosts Today:
Howard Greenberg
TLCC
@TLCCLtd
Ask an XPages Expert
Paul Della-Nebbia
TLCC
@PaulDN
How can TLCC Help YOU!
2
• Private classes at
your location or
virtual
•XPages Development
•Support Existing Apps
•Administration
• Let us help you
become an expert
XPages developer!
• Delivered via Notes
• XPages
• Development
• Admin
• User
Self-
Paced
Courses
Mentoring
Instructor-
Led
Classes
Application
Development
and
Consulting
Free
Demo
Courses!
Upcoming and Recorded Webinars
3
www.tlcc.com/xpages-webinar
View Previous Webinars
(use url above)
• Using Cool New Frameworks in (Mobile)
Domino Apps! with Theo Heselmans
– December 16th
Asking Questions – Q and A at the end
4
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions pane!
We will answer your questions
verbally at the end of the
webinar
Your Presenters Today:
5
#XPages
Mike McGarel
@mmcgarel
Building on
Properties
Jesse Gallagher
@Gidgerby
Controller
Classes
David Leedy
@DavidLeedy
Time to First
Byte
Nathan Freeman
@NTF
Give It a Rest
Building on Properties
With one house:
Mike McGarel
Collaborative Solutions Developer
With several (ware)houses:
Czarnowski Display Service Inc.
With an email address:
mcgarelgramming@gmail.com
Building on Properties
Agenda
Custom Property - Custom Control
✴ Example: single custom control
✴ Example: multiple custom controls
✦ Custom Property - XPage
✴ Example: side menu
✴ Example: bread crumb navigation
2
Building on Properties
XPage - Red Properties
3
Building on Properties
Setup on Custom Control - String value
4
Building on Properties
Color Style Classes
.

.red {
background-color: #ff0000;
}
.green {
background-color: #008000;
}
.blue {
background-color: #87ceeb;
}
5
Building on Properties
Setup on Custom Control - Java object
6
Building on Properties
Java Sample - Squares Class
7
Building on Properties
Custom Control - Properties Use
8
Building on Properties
compositeData
Reference to access property
Sample: value=“#{compositeData.propertyname}”
Custom property map
Built-in getters and setters
9
Building on Properties
XPage Source - Red Properties Sample
10
Building on Properties
XPage - Red Properties
11
Building on Properties
Java Sample - Multiple Class
private String firstStyleName;
private String secondStyleName;
private String thirdStyleName;
public Multiples() {
this.firstStyleName = "red";
this.secondStyleName = "green";
this.thirdStyleName = "blue";
}
12
Building on Properties
XPage Source - Multiple Controls Sample
13
<xp:this.beforePageLoad>

<![CDATA[#{javascript:viewScope.put('currentPage', 

new com.demo.Multiples());}]]></xp:this.beforePageLoad>
<xc:cc_Layout>
<xp:this.facets>
<xp:div xp:key="facet_1">
<xc:cc_SquaresAdvanced squaresList=“#{Squares.redList}"
styleName="#{viewScope.currentPage.firstStyleName}">
</xc:cc_SquaresAdvanced>
<xc:cc_SquaresAdvanced squaresList=“#{Squares.greenList}"
styleName="#{viewScope.currentPage['secondStyleName']}">
</xc:cc_SquaresAdvanced>
<xc:cc_SquaresAdvanced squaresList="#{Squares.blueList}"
styleName="#{javascript:viewScope.currentPage().getThirdStyleName()
}">
</xc:cc_SquaresAdvanced>
Building on Properties
XPage - Multiple Properties
14
Building on Properties
XPage Source - Menu Highlight Sample
15
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.properties>
<xp:parameter value="Multiple" name=“menuKey”>
</xp:parameter>

</xp:this.properties>
Building on Properties
Custom Control Source - Menu Sample
16
<li>
<xp:link text="Multiple" id="link5" disableTheme=“true”>
<xp:this.styleClass>
<![CDATA[#{javascript: if
('Multiple'.equals(facesContext.getProperty('menuKey'))) {
return 'menuButton menuActive';
} else {
return 'menuButton';
} }]]></xp:this.styleClass>
<xp:this.value><![CDATA[#{javascript:if
(!'Multiple'.equals(facesContext.getProperty('menuKey'))) {
return '/multiplesquares.xsp';
}}]]></xp:this.value>
</xp:link>
</li>
Building on Properties
XPage - Breadcrumb Navigation (1)
17
Building on Properties
XPage - Breadcrumb Navigation (2)
18
Building on Properties
XPage - Breadcrumb Navigation (3)
19
Building on Properties
XPage Source - Breadcrumb Properties
20
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://
www.ibm.com/xsp/custom"
pageTitle="#{javascript:facesContext.getProperty('pageKey')}">
<xp:this.properties>
<xp:parameter value="" name="menuKey"></xp:parameter>
<xp:parameter value="#{param.name}" name="pageKey"></xp:parameter>
<xp:parameter value="#{param.category}" name="categoryKey">

</xp:parameter>
</xp:this.properties>
Building on Properties
XPage Source - Breadcrumb (1)
21
<xp:panel tagName="ul" styleClass="nav navbar-nav”>
<xp:panel tagName=“li">
<xp:this.styleClass><![CDATA[#{javascript: if 

( ('Home').equals(facesContext.getProperty('pageKey')) ) {
return 'navHome';
}}]]></xp:this.styleClass>
<xp:link escape="true" text="#{config.appTitle}" id="linkHome">
<xp:this.value><![CDATA[#{javascript: if 

(! ('Home').equals(facesContext.getProperty('pageKey')) ) {
return facesContext.getExternalContext().getRequestContextPath();
}}]]></xp:this.value>
</xp:link>
</xp:panel>
<xp:panel tagName=“li"
rendered="#{javascript:facesContext.getProperty('categoryKey')}">
<a class=“separator”>&gt;</a>
</xp:panel>
Building on Properties
XPage Source - Breadcrumb (2)
22
<xp:panel tagName="li"
rendered="#{javascript:facesContext.getProperty('categoryKey')}">
<xp:link escape="true"

text="#{javascript:facesContext.getProperty('categoryKey')}" 

id=“linkCategory" value="#{javascript:return 

config.getPageLinks().get(facesContext.getProperty('categoryKey'));}">

</xp:link>
</xp:panel>
<xp:panel tagName=“li" rendered="#{javascript:

!('Home').equals(facesContext.getProperty('pageKey'))}">
<a class="separator">&gt;</a>
</xp:panel>
<xp:panel tagName="li" styleClass=“navActive" rendered="#{javascript:

!('Home').equals(facesContext.getProperty('pageKey'))}">
<xp:text escape="true"
value="#{javascript:facesContext.getProperty('pageKey')}"
tagName="a">
</xp:text>
</xp:panel>
</xp:panel>
Building on Properties
Thank you!
23
NotesIn9.comNotesIn9.com
TLCC / Teamstudio Webinar
• NotesIn9.com
 XPages.TV - episode List
 XPagesCheatSheet.com - cheatsheets
• XPages.Slack.com
 http://xpages-slack-invites.herokuapp.com/
• Jesse Gallagher
 Page Controllers - MVC style programming
NotesIn9 182, 166-168
• Time to First Byte
 StandBy Dialog Custom Control
http://openntf.org/XSnippets.nsf/snippet.xsp?id=standby-dialog-custom-control
 http://xpagesera.blogspot.com/2012/05/add-ajax-loading-control-in-xpages-for.html
1
Give It a REST
Nathan T. Freeman
Co-founder, Red Pill Now
Quick fundamentals
 REpresentational State Transfer
 TypicallyJSON-based
 Stateless
Why REST?
 Fast
 Flexible
 Scalable
 Uniform
Why DDS?
 Apache Wink standard
 Already understands Domino context
Some examples from DDS
 GET http://{server}/api/data
[
{
"@title":"Administration Requests",
"@filepath":"admin4.nsf",
"@replicaid":"8525786A034D582B",
"@template":"StdR4AdminRequests",
"@href":"http://server/admin4.nsf/api/data/collections"
},
{
"@title":"Java AgentRunner",
"@filepath":"AgentRunner.nsf",
"@replicaid":"8525671400725208",
"@template":"",
"@href":"http://server/AgentRunner.nsf/api/data/collections"
},
{
"@title":"Article",
"@filepath":"Article.nsf",
"@replicaid":"8525784E00618FED",
"@template":"",
"@href":"http://server/Article.nsf/api/data/collections"
}
]
Some examples from DDS
 GET http://{server}/{database}/api/data/documents/unid/{docunid}?{parameters}
{
"@href":"http://server/XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019",
"@unid":"5D006566E919779E852578B7004A6019",
"@noteid":"906",
"@created":"2011-06-22T13:32:22Z",
"@modified":"2011-08-21T14:39:31Z",
"@authors": ["CN=Robert Perron/OU=Westford/O=IBM","CN=rperronadmin/O=rtest","CN=rperronadmin/O=rtest"],
"@form":"Contact",
"$UpdatedBy":"CN=Robert
Perron/OU=Westford/O=IBM;CN=rperronadmin/O=rtest;Anonymous;CN=rperronadmin/O=rtest",
"$Revisions":"06/22/2011 09:32:22 AM;06/22/2011 09:33:17 AM;08/15/2011 12:16:31 PM",
"FirstName":"Barney",
"LastName":"Bloomberg",
"Number":1.75,
"Date": ["2011-07-21T20:21:00Z","2011-08-01T14:38:00Z"],
"Body":
{
"contentType":"text/html",
"data":"Just <b>sales</b>.",
"type":"richtext"
}
}
Some examples from DDS
 PUT http://{server}/{database}/api/data/documents/unid/{docunid}?{parameters}
Content-Type: application/json
Accept: application/json
X-HTTP-Method-Override: PATCH
{"FirstName":"Barney", "LastName":"Bloomberg", "EMail":"bbbb@acme.com",
"Number":1.75,
"Date":["2011-08-21T20:21:00Z", "2011-08-01T14:38:00Z"],
"Body":{"contentType":"text/html", "data":"Just <b>sales</b>.",
"type":"richtext"},
"City":"new york city"}
DDS Shortcomings
 Always delivers ALL document contents
 No authenticationfacility
 Raw data format
 No validation
Extending DDS: The Ingredients
 com.ibm.domino.das.service.RestService
 REST Resources
 javax.ws.rs.*
 com.ibm.commons.util.io.json.JsonObject
 com.ibm.domino.osgi.core.context.ContextInfo
 com.ibm.commons.util.io.json.util.JsonWriter
Extending DDS: RestService
 .getClasses()
 .getSingletons()
 Example: IBM Calendar Service
 plugin.xml
 Example: IBM Calendar
Extending DDS: REST Resources
 javax.ws.rs Annotation-based
 @Path defines URL routing for resource class
 @GET, @POST, @PUT, @DELETE defines handlers for methods
 @Context, @HeaderParam, @PathParam, @QueryParam define attributes
for method arguments
 Example: GET Calendar Notice Resource
 Example: POST Calendar Notice Action Resource
@Path("calendar/notices/" + PATH_PARAM_NOTICE + "/action")
public class NoticeActionResource {
@PUT
public Response putNoticeAction(String requestEntity, @HeaderParam("Content-Type")
String contentType, @Context UriInfo uriInfo, @PathParam(NOTICE) String id,
@QueryParam(URL_PARAM_ACTION_TYPE) String type)
Extending DDS: JSON Adapters
 Implement JsonObject
 .getJsonProperties()
 .getJsonProperty(String)
 .putJsonProperty(String)
 Example: IBM JSON Alarm Adapter
Extending DDS: ContextInfo
 Static context utilities
 .getUserSession()
 .getUserDatabase();
Extending DDS: Json Writer
 Controls JSON output from Java objects
 .outObject(Object)
 Example: OpenNTF JSON Graph Writer
Thanks for coming!
 More details on DDS can be found at
http://infolib.lotus.com/resources/domino/8.5.3/doc/designer_up1/en_us/D
ominoDataService.html
Questions????
6
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions panel!
Remember, we will answer your
questions verbally
#XPages
@DavidLeedy
@mmcgarel
@Gidgerby
@NTF
@TLCCLtd
@Teamstudio
@PaulDN
Upcoming Events:
 Atlanta User Group – November 19th
 Granite LUG Meeting, Chicago – Dec 2nd
 Connect, Orlando – Jan. 31 to Feb. 3
 IBM InterConnect, Las Vegas, NV - Feb 21 to 25th
 Engage, Eindhoven, the Netherlands – Mar. 23 to 24
 EntwicklerCamp, Gelsenkirchen, Germany – April 11 to 13
Question and Answer Time!
7
Teamstudio Questions?
contactus@teamstudio.com
978-712-0924
TLCC Questions?
howardg@tlcc.com paul@tlcc.com
888-241-8522 or 561-953-0095
Howard
Greenberg
Courtney
Carter
Mike McGarel Jesse GallagherDavid Leedy Nathan Freeman
Paul
Della-Nebbia