Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • Application
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • iPhone
  • Java
  • JavaScript
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • xsp-config
  • データソース
  • 九州地区ノーツパートナー会
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > XPage Tutorials > Creating an Xpage resource file via DXL without a temporary file
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Creating an Xpage resource file via DXL without a temporary file 

expanded Abstract
collapsed Abstract
File resources are a great way of allowing user configurability in Xpage applications, for example field labels, configurable blocks of text or the choices for dialog boxes. This article shows how users can add configurable information through a simple form and that data can then be transferred to a resource file where it can be used by the Xpage application.
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Entering the configuration
  • 3 The structure of the file resource
  • 4 Retrieving the settings
  • 5 The code to create the resource file

Introduction


In Xpages resource files can be used to store settings. This is a great way of increasing the configurability of your application ( labels, keyword choices etc )  without having to carry the overhead of frequent look-ups to Notes configuration documents. This approach is a core part of the Steve Castledines OpenNTF Xpages Framework and has also been recommended by Matt White.

This article describes how to create a resource file via DXL using a stream so that an intermediate file on the hard drive is not needed. The code incorporates other code from Julian Robichaux for managing the Base64 encoding.
 

Entering the configuration

The application has a series of configuration documents. As each is saved in the UI it calls a back end LotusScript agent which creates a file resource. The Xpage application pulls the settings directly from this file resource rather than from the documents themselves.
The system does not attempt to update the file resource but creates a new one from scratch by cycling though the view and adding information for each record.
 
image
 

The structure of the file resource

Note that although the structure looks straight forward it is saved as Base64. You can see this by using the Tools > DXL Utilities > Exporter tool
 
image
 

Retrieving the settings

The settings can be retrieved using the code below, note that you also need to include the file as a resource bundle
 
image
 
image
 

The code to create the resource file

 
image
 
The crux to creating the file resource is that it is in base64 so you will need to use some code originally developed by Julian Robichaux and published on OpenNTF.
 
I have attached the whole script library at the end of the article. The entry point called by the agent is Sub s_CreateFileResourceFromView_6_01
 
image
 
I have posted the code as an attachment. Apologies for not including a demo database but I would need to strip the functionality out of a commercial system. The attached code has plenty of commenting.
 
Since this wiki won't let me upload the script file you can get it here => http://focul.bucket1.s3.amazonaws.com/public_downloads/FoCul.LS.ResourceManipulation.7.02.lss
 
Sean Cull
http://www.seancull.co.uk
http://www.focul.net

expanded Article information
collapsed Article information
Category:
XPage Tutorials
Tags:
File resource, DXL, Xpages, File Resources, tutorials

This Version: Version 10 October 13, 2010 4:57:35 AM by sean cull  

expanded Attachments (6)
collapsed Attachments (6)

 


File TypeSizeFile NameCreated On
image/gif 18 KB img1.gif 9/18/10 4:20 PM
image/gif 20 KB img2.gif 9/18/10 4:20 PM
image/gif 11 KB img3.gif 9/18/10 4:20 PM
image/gif 14 KB img4.gif 9/18/10 4:20 PM
image/gif 13 KB img5.gif 9/18/10 4:20 PM
image/gif 46 KB img6.gif 9/18/10 4:20 PM
expanded Versions (10)
collapsed Versions (10)
Version Comparison     
Version Date Changed by               Summary of changes
This version (10) Oct 13, 2010 4:57:35 AM sean cull   corrected typos
9 Sep 18, 2010 4:43:07 PM sean cull  
8 Sep 18, 2010 4:37:52 PM sean cull  
7 Sep 18, 2010 4:30:02 PM sean cull  
6 Sep 18, 2010 4:29:33 PM sean cull  
5 Sep 18, 2010 4:28:39 PM sean cull  
4 Sep 18, 2010 4:27:47 PM sean cull  
3 Sep 18, 2010 4:25:11 PM sean cull  
2 Sep 18, 2010 4:23:59 PM sean cull  
1 Sep 18, 2010 4:20:01 PM sean cull  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use