SlideShare ist ein Scribd-Unternehmen logo
1 von 33
xe:objectData
Door Thimo Jansen
Introductie
* Thimo Jansen
* IBM Domino web developer
* http://www.defrog.nl
Agenda
* xe:objectData
* Managed Beans
* Overeenkomsten
* Verschillen
* Voordelen
* Demo
* Bonus
xe:objectData
xe:objectData // data source
Data Source
uit de
Extension Library
xe:objectData // waar
Als datasource bij een:
* XPage
* Panel
- in een repeat
- Single Page Application
xe:objectData // voorbeeld
dominoDocument vs objectData
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
! <xp:this.data>
! ! <xp:dominoDocument var="objectDataDocument" formName="fObjectdata"
action="openDocument"></xp:dominoDocument>
! ! <xe:objectData var="objectDataTest" scope="view">
! ! ! <xe:this.createObject>
<![CDATA[#{javascript:new nl.defrog.objectData.Test();}]]>
</xe:this.createObject>
! ! ! <xe:this.saveObject>
<![CDATA[#{objectDataTest.save}]]>
</xe:this.saveObject>
! ! </xe:objectData>
! </xp:this.data>
</xp:view>
xe:objectData // properties
* createObject
* saveObject
- Simple action
xe:objectData // voorbeeld
dominoDocument vs objectData
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
! <xp:this.data>
! ! <xp:dominoDocument var="objectDataDocument" formName="fObjectdata"
action="openDocument"></xp:dominoDocument>
! ! <xe:objectData var="objectDataTest" scope="view">
! ! ! <xe:this.createObject>
<![CDATA[#{javascript:new nl.defrog.objectData.Test();}]]>
</xe:this.createObject>
! ! ! <xe:this.saveObject>
<![CDATA[#{objectDataTest.saveAction}]]>
</xe:this.saveObject>
! ! </xe:objectData>
! </xp:this.data>
</xp:view>
xe:objectData // scope
* request
* view
* session
* application
xe:objectData // voorbeeld
Uitlezen variable via EL:
<xp:text value="#{objectDataTest.index}"></xp:text>
Of SSJS:
<xp:text value="#{javascript:objectDataTest.getIndex()}"></xp:text>
xe:objectData // voorbeeld
Value binding voor tekstveld:
<xp:inputText value="#{objectDataTest.index}"></xp:inputText>
xe:objectData // voorbeeld
Opslaan via simple action:
<xp:button value="Save" id="button1">
! <xp:eventHandler event="onclick" submit="true"refreshMode="full">
! ! <xp:this.action>
! ! ! <xp:saveDocument var="objectDataTest"></xp:saveDocument>
! ! </xp:this.action>
! </xp:eventHandler>
</xp:button>
xe:objectData // voorbeeld
Opslaan via EL:
<xp:button value="Save" id="button1">
! <xp:eventHandler event="onclick" submit="true" refreshMode="full">
! ! <xp:this.action>
<![CDATA[#{objectDataTest.saveAction}]]>
</xp:this.action>
! </xp:eventHandler>
</xp:button>
xe:objectData // voorbeeld
Opslaan via SSJS:
<xp:button value="Save" id="button1">
! <xp:eventHandler event="onclick" submit="true" refreshMode="full">
! ! <xp:this.action>
<![CDATA[#{javascript:objectDataTest.saveAction();}]]>
</xp:this.action>
! </xp:eventHandler>
</xp:button>
Managed Beans
Beans // Definitie
* Plain Old Java Object (POJO)
* Serializable
* Parameter-less, public constructor
* Getters en setters
Beans // Voorbeeld
package nl.defrog.objectData;
import java.io.Serializable;
public class MyFirstBean implements Serializable {
! private static final long serialVersionUID = 1L;
! private String name;
!
! public MyFirstBean() {
! ! // Constructor
! }
! public String getName() {
! ! return name;
! }
! public void setName(String name) {
! ! this.name = name;
! }
}
Beans // Configuratie
In Faces-config
* Name
* Class
* Scope
* Properties
Beans // Configuratie
<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
! <managed-bean>
! ! <managed-bean-name>myFirstBean</managed-bean-name>
! ! <managed-bean-class>nl.defrog.objectData.MyFirstBean</managed-bean-class>
! ! <managed-bean-scope>session</managed-bean-scope>
! ! <managed-property>
! ! ! <property-name>name</property-name>
! ! ! <value>Thimo Jansen</value>
! ! </managed-property>
! </managed-bean>
</faces-config>
Application Configuration / Faces-config
Beans // voorbeeld
Uitlezen variable via EL:
<xp:text value="#{myFirstBean.name}"></xp:text>
Of SSJS:
<xp:text value="#{javascript:myFirstBean.getName()}"></xp:text>
Beans // voorbeeld
Value binding voor tekstveld:
<xp:inputText value="#{myFirstBean.name}"></xp:inputText>
Beans // voorbeeld
Opslaan via EL:
<xp:button value="Save" id="button1">
! <xp:eventHandler event="onclick" submit="true" refreshMode="full">
! ! <xp:this.action>
<![CDATA[#{myFirstBean.saveAction}]]>
</xp:this.action>
! </xp:eventHandler>
</xp:button>
Beans // voorbeeld
Opslaan via SSJS:
<xp:button value="Save" id="button1">
! <xp:eventHandler event="onclick" submit="true" refreshMode="full">
! ! <xp:this.action>
<![CDATA[#{javascript:myFirstBean.saveAction();}]]>
</xp:this.action>
! </xp:eventHandler>
</xp:button>
Overeenkomsten
Overeenkomsten
* Plain Old Java Object (POJO)
* Serializable
* Getters / setters
* Scoped
Verschillen
Verschillen
* objectData
* explicit initialization
* Bean
* parameter-less constructor
* scope lifecycle
Voordelen
Voordelen
* Invloed op initialisatie
* Simple action save
* Past in xp:repeat
* Geen centrale configuratie
* SPA met Dynamic Loading
Demo
Bonus
Contact
thimo@defrog.nl // @thimo
http://blog.defrog.nl
http://linkedin.com/in/thimojansen

Weitere ähnliche Inhalte

Andere mochten auch

SpeedGeeking! Mobile Application development with IBM XPages
SpeedGeeking! Mobile Application development with IBM XPagesSpeedGeeking! Mobile Application development with IBM XPages
SpeedGeeking! Mobile Application development with IBM XPagesBruce Elgort
 
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.CloudGavin Bollard
 
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...Bruce Elgort
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinarMark 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
 
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 DevelopmentTeamstudio
 
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...panagenda
 
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 productivitySocialBiz 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 FirstJohn 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 - OpenNTFNiklas 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 ControlsTeamstudio
 
Aveedo - Your application framework
Aveedo - Your application frameworkAveedo - Your application framework
Aveedo - Your application frameworkWe4IT Group
 
Entwicklercamp responive web design
Entwicklercamp   responive web designEntwicklercamp   responive web design
Entwicklercamp responive web designHenning Schmidt
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi DevelopmentPaul 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 PracticesTeamstudio
 
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
 

Andere mochten auch (19)

SpeedGeeking! Mobile Application development with IBM XPages
SpeedGeeking! Mobile Application development with IBM XPagesSpeedGeeking! Mobile Application development with IBM XPages
SpeedGeeking! Mobile Application development with IBM XPages
 
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 ...
 
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
 
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...
Apps, Apps, and More Apps: Meet the Very Best Open Source Apps from OpenNTF -...
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
 
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)
 
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...
 
Java for XPages Development
Java for XPages DevelopmentJava for XPages Development
Java for XPages Development
 
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...
BP107: Ten Lines Or Less: Interesting Things You Can Do In Java With Minimal ...
 
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
 
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
 
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
 
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
 
Aveedo - Your application framework
Aveedo - Your application frameworkAveedo - Your application framework
Aveedo - Your application framework
 
Entwicklercamp responive web design
Entwicklercamp   responive web designEntwicklercamp   responive web design
Entwicklercamp responive web design
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
 
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
 
Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13
 
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®
 

Mehr von Thimo Jansen

Van EVI naar IRIS, mijn eerste XPages applicatie
Van EVI naar IRIS, mijn eerste XPages applicatieVan EVI naar IRIS, mijn eerste XPages applicatie
Van EVI naar IRIS, mijn eerste XPages applicatieThimo Jansen
 
AuditCase & XPages
AuditCase & XPagesAuditCase & XPages
AuditCase & XPagesThimo Jansen
 
XPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesXPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesThimo Jansen
 
XPages * XDocReport = X3
XPages * XDocReport = X3XPages * XDocReport = X3
XPages * XDocReport = X3Thimo Jansen
 
Een XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformEen XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformThimo Jansen
 
Engage - XPages & Beer
Engage - XPages & BeerEngage - XPages & Beer
Engage - XPages & BeerThimo Jansen
 
Silverside CCTY Developers Update
Silverside CCTY Developers UpdateSilverside CCTY Developers Update
Silverside CCTY Developers UpdateThimo Jansen
 

Mehr von Thimo Jansen (9)

TeamPlan brochure
TeamPlan brochureTeamPlan brochure
TeamPlan brochure
 
Van EVI naar IRIS, mijn eerste XPages applicatie
Van EVI naar IRIS, mijn eerste XPages applicatieVan EVI naar IRIS, mijn eerste XPages applicatie
Van EVI naar IRIS, mijn eerste XPages applicatie
 
AuditCase & XPages
AuditCase & XPagesAuditCase & XPages
AuditCase & XPages
 
XPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesXPages & Beer - Behind the scenes
XPages & Beer - Behind the scenes
 
XPages * XDocReport = X3
XPages * XDocReport = X3XPages * XDocReport = X3
XPages * XDocReport = X3
 
Een XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformEen XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatform
 
Engage - XPages & Beer
Engage - XPages & BeerEngage - XPages & Beer
Engage - XPages & Beer
 
Silverside CCTY Developers Update
Silverside CCTY Developers UpdateSilverside CCTY Developers Update
Silverside CCTY Developers Update
 
Of REST and Beans
Of REST and BeansOf REST and Beans
Of REST and Beans
 

xe:objectData

  • 2. Introductie * Thimo Jansen * IBM Domino web developer * http://www.defrog.nl
  • 3. Agenda * xe:objectData * Managed Beans * Overeenkomsten * Verschillen * Voordelen * Demo * Bonus
  • 5. xe:objectData // data source Data Source uit de Extension Library
  • 6. xe:objectData // waar Als datasource bij een: * XPage * Panel - in een repeat - Single Page Application
  • 7. xe:objectData // voorbeeld dominoDocument vs objectData <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex" xmlns:xc="http://www.ibm.com/xsp/custom"> ! <xp:this.data> ! ! <xp:dominoDocument var="objectDataDocument" formName="fObjectdata" action="openDocument"></xp:dominoDocument> ! ! <xe:objectData var="objectDataTest" scope="view"> ! ! ! <xe:this.createObject> <![CDATA[#{javascript:new nl.defrog.objectData.Test();}]]> </xe:this.createObject> ! ! ! <xe:this.saveObject> <![CDATA[#{objectDataTest.save}]]> </xe:this.saveObject> ! ! </xe:objectData> ! </xp:this.data> </xp:view>
  • 8. xe:objectData // properties * createObject * saveObject - Simple action
  • 9. xe:objectData // voorbeeld dominoDocument vs objectData <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex" xmlns:xc="http://www.ibm.com/xsp/custom"> ! <xp:this.data> ! ! <xp:dominoDocument var="objectDataDocument" formName="fObjectdata" action="openDocument"></xp:dominoDocument> ! ! <xe:objectData var="objectDataTest" scope="view"> ! ! ! <xe:this.createObject> <![CDATA[#{javascript:new nl.defrog.objectData.Test();}]]> </xe:this.createObject> ! ! ! <xe:this.saveObject> <![CDATA[#{objectDataTest.saveAction}]]> </xe:this.saveObject> ! ! </xe:objectData> ! </xp:this.data> </xp:view>
  • 10. xe:objectData // scope * request * view * session * application
  • 11. xe:objectData // voorbeeld Uitlezen variable via EL: <xp:text value="#{objectDataTest.index}"></xp:text> Of SSJS: <xp:text value="#{javascript:objectDataTest.getIndex()}"></xp:text>
  • 12. xe:objectData // voorbeeld Value binding voor tekstveld: <xp:inputText value="#{objectDataTest.index}"></xp:inputText>
  • 13. xe:objectData // voorbeeld Opslaan via simple action: <xp:button value="Save" id="button1"> ! <xp:eventHandler event="onclick" submit="true"refreshMode="full"> ! ! <xp:this.action> ! ! ! <xp:saveDocument var="objectDataTest"></xp:saveDocument> ! ! </xp:this.action> ! </xp:eventHandler> </xp:button>
  • 14. xe:objectData // voorbeeld Opslaan via EL: <xp:button value="Save" id="button1"> ! <xp:eventHandler event="onclick" submit="true" refreshMode="full"> ! ! <xp:this.action> <![CDATA[#{objectDataTest.saveAction}]]> </xp:this.action> ! </xp:eventHandler> </xp:button>
  • 15. xe:objectData // voorbeeld Opslaan via SSJS: <xp:button value="Save" id="button1"> ! <xp:eventHandler event="onclick" submit="true" refreshMode="full"> ! ! <xp:this.action> <![CDATA[#{javascript:objectDataTest.saveAction();}]]> </xp:this.action> ! </xp:eventHandler> </xp:button>
  • 17. Beans // Definitie * Plain Old Java Object (POJO) * Serializable * Parameter-less, public constructor * Getters en setters
  • 18. Beans // Voorbeeld package nl.defrog.objectData; import java.io.Serializable; public class MyFirstBean implements Serializable { ! private static final long serialVersionUID = 1L; ! private String name; ! ! public MyFirstBean() { ! ! // Constructor ! } ! public String getName() { ! ! return name; ! } ! public void setName(String name) { ! ! this.name = name; ! } }
  • 19. Beans // Configuratie In Faces-config * Name * Class * Scope * Properties
  • 20. Beans // Configuratie <?xml version="1.0" encoding="UTF-8"?> <faces-config> ! <managed-bean> ! ! <managed-bean-name>myFirstBean</managed-bean-name> ! ! <managed-bean-class>nl.defrog.objectData.MyFirstBean</managed-bean-class> ! ! <managed-bean-scope>session</managed-bean-scope> ! ! <managed-property> ! ! ! <property-name>name</property-name> ! ! ! <value>Thimo Jansen</value> ! ! </managed-property> ! </managed-bean> </faces-config> Application Configuration / Faces-config
  • 21. Beans // voorbeeld Uitlezen variable via EL: <xp:text value="#{myFirstBean.name}"></xp:text> Of SSJS: <xp:text value="#{javascript:myFirstBean.getName()}"></xp:text>
  • 22. Beans // voorbeeld Value binding voor tekstveld: <xp:inputText value="#{myFirstBean.name}"></xp:inputText>
  • 23. Beans // voorbeeld Opslaan via EL: <xp:button value="Save" id="button1"> ! <xp:eventHandler event="onclick" submit="true" refreshMode="full"> ! ! <xp:this.action> <![CDATA[#{myFirstBean.saveAction}]]> </xp:this.action> ! </xp:eventHandler> </xp:button>
  • 24. Beans // voorbeeld Opslaan via SSJS: <xp:button value="Save" id="button1"> ! <xp:eventHandler event="onclick" submit="true" refreshMode="full"> ! ! <xp:this.action> <![CDATA[#{javascript:myFirstBean.saveAction();}]]> </xp:this.action> ! </xp:eventHandler> </xp:button>
  • 26. Overeenkomsten * Plain Old Java Object (POJO) * Serializable * Getters / setters * Scoped
  • 28. Verschillen * objectData * explicit initialization * Bean * parameter-less constructor * scope lifecycle
  • 30. Voordelen * Invloed op initialisatie * Simple action save * Past in xp:repeat * Geen centrale configuratie * SPA met Dynamic Loading
  • 31. Demo
  • 32. Bonus