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 > IBM Redbooks: Building Domino Web Applications using Domino 8.5.1 > Section VI - Understanding Domino design elements, specific to building an XPages application
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Section VI - Understanding Domino design elements, specific to building an XPages application 

expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Introduction to this section
  • 2 XPage View control
    • 2.1 Pager
    • 2.2 Filtering within the view
    • 2.3 Searching within the view
    • 2.4 Searching Techniques
  • 3 XPage Repeat control
    • 3.1 Adding a Repeat Control to your XPage
    • 3.2 Adding Row Data
    • 3.3 Pager
    • 3.4 Filtering or Searching using a Repeat Control
  • 4 Themes
    • 4.1 Examples of ways to use themes
    • 4.2 Extended use of themes
  • 5 Reuse of current Domino code
    • 5.1 URLs
    • 5.2 Reusing Existing LotusScript Logic
    • 5.3 Use Web Site Rule Substitution
  • 6 Active Content Filtering ACF
    • 6.1 Client Side JavaScript
    • 6.2 Server Side JavaScript SSJS
  • 7 Adding Java to template and build path
    • 7.1 Using Pure Java within SSJS
Table of Contents | Previous Page | Next Page

Introduction to this section


This section is intended to help you better understand the Domino design elements which are especially relevant within an XPage application.It also provides some recommendations for dealing with existing Domino code.

The design elements highlighted here include:
  • The XPage View Control
  • The XPage Repeat Control
  • Themes
  • Recommendations and Considerations for Re-use of existing Domino Code
  • Methods for Active Content Filtering
  • Methods for adding Java to the template and build path

XPage View control


The XPage View Control is the main XPage building block for displaying tabular data that is quick and easy to use. The rows, columns, titles and pager are all added for you, allowing you to quickly customize it after it's created.
You can embed multiple views in the same XPage, even from different nsf's. The View control automatically shows category “twisties” for categorized columns as before. Finally, note that it is not a property – it is read from view design
sectVI_1.png

The XPages View Control is a Container Control, and is Wizard driven, allowing you to get the view created quickly.

sectVI_2.png

The image below illustrates the Wizard used for creating and defining the new View Control.

sectVI_3.png

Pager


The pager is the navigation control used to move between pages of tabular data. It is automatically added as part of the view control

sectVI_4.png

The pager has further configuration options that let you select which individual controls to show. These are set within the properties.

sectVI_5.png

Filtering within the view


Views can easily be filtered via the All Properties of the view control panel.

sectVI_6.png

Filtering the basic categorized view was done with the the setting “&restricttocategory=” in a standard Domino View or embedded view via “show single category”.

sectVI_7.png

Now this is done through the property categoryFilter.

sectVI_8.png

This can be a hard coded text value, computed value (e.g.from a custom control setting), or taken from a URL. To take a value from a URL use context.getUrlParameter("RestrictToCategory"). This would pull from the URL "/xpage.xsp?&RestrictToCategory=Customer self-assist" and restrict the view to the category "Customer Self-assist"

Filtering is done by using keys similar to the LotusScript view.getAllDocumentsByKey. This enables you to filter by more than one column by using the property “keys”. This can be a hard coded text value, computed value, or taken from a URL

The example below illustrates how the filter takes a java.util.Vector as a parameter:
sectVI_code1.png

sectVI_9.png
Note - You can use the property “keysExactMatch” to specify an exact match value. The default is false.

Searching within the view


Filtering a view by using a search parameter is similar to standard filtering, but uses the parameter “search”. It works then like a normal view control (navigation via pager etc).

sectVI_10.png

Note - You can also use the optional parameter using “searchMaxDocs” to restrict the number of results returned for search.

Searching Techniques


The following section describes one technique to request and process search.
There are two parts to this:
  • First Step - supply Edit Box to take search parameter. To do this,
1) Add the control Edit Box
sectVI_11.png

2) In Data properties, link to “Scoped Variable” - “View Scope” and give data a name (this then places the data in memory to be picked up by search action Link)

sectVI_12.png

Note - You can also use the optional parameter using “searchMaxDocs” to restrict the number of results returned for search.
  • Second step - supply the submit button to send the search parameter. To do this:

1) Add Link control
2) Using either a computed Link or onClick Event to compute the next page or url and retrieve the search value using “viewScope.searchValue”.
sectVI_code2.png

3) From the wiki template – custom control “prtTitleBar” - is an onClick event to open an Xpage. The value is computed as shown below

sectVI_13a.png
sectVI_13b.png


Please refer to the additional View Control Resources on the Lotus Wiki

  • Working with View Controls
  • How To Create a View Control
  • Working with View Controls - Display HTML
  • Working with View Controls - Computed Column

Back to Top

XPage Repeat control


XPage control for “repeating” data is an essential developer tool. It enables you to create “views” of data like a view control, however with more degrees of flexibility (e.g. multiple rows of data per document). This can also be used for those small lists – computed sidebar links, lists of “anything” (e.g - in the wiki – categories, tags, popular pages).

So use this approach to go from the very simple to the very complex.

Here is a simple example case shown below:

sectVI_14.png

And, here is a more complex example case. Building upon the complex example, you can allow multiple lists on the same XPage – from multiple sources.

sectVI_15.png

Adding a Repeat Control to your XPage



The XPage Repeat Control is a “Container Control” that the developer manually configures using properties in Domino Designer

sectVI_16.png

To begin working with the Repeat Control, first you assign the data source via properties and give a “Collection Name” as shown in the example below.

sectVI_17.png

The image below shows how to create a link to the data source.

sectVI_18.png

Adding Row Data


You can add anything to your repeat (text, field data, images etc). Just drag them into the repeat box (tip - use “source” for fine tuning)
You have direct access to the data source and can create your own html

sectVI_19.png

You access the data source using collectionName.getColumnValue("field") for each individual field/value.

sectVI_20.png

You can even nest repeat controls to give you even more power. For example, you could create a fancy list of data within each row, possibly from a multi value field of tags. The example below shows nested repeat controls.

sectVI_21.png

Note - See wiki template custom control “prtView” for the main view component. This uses a repeat control to display the view.

Pager


The pager is the navigation control used to move between pages of tabular data. Unlike the view control you need to add it/them manually using the “core control” “pager”.

sectVI_22.png

When you add your pager you need to first attach it to the repeat control it should work with. This allows you to have multiple lists of working data on one XPage. The operation of the pager is then automatic with no further coding required.

sectVI_23.png

The pager has further configuration options that let you select which individual controls to show. These are set within the properties.

sectVI_24.png

sectVI_25.png

Note - See the custom control “prtView” to see pagers top and bottom of the repeat list and the configuration used.

Filtering or Searching using a Repeat Control


Filtering or searching using a Repeat control is done identically to View Controls. (See the section above, Filtering within the view )

To detecting the Number of Rows, use SSJS getComponent("repeatID")". The count is then referenced .getRowCount()

Back to Top

Themes


Themes are for determining which style sheets to use for your application and/or the styling for individual components.
  • They are found under Resources > Themes (an XML file).
  • You can set themes globally for the server (dominodata/properties/xsp.properties) or by nsf via application properties > XPages.
  • They can inherit from other themes such as the in built WebStandard or OneUI ().
  • The settings higher up the tree (themes you have extended from, styling set within the control) can be overridden by using
  • Stylesheet and styling information is fully computable: rendered="#{javascript:context.isDirectionRTL()}"

There are many advantages to using themes, although you can still just use a stylesheet on its own. Some of these advantages to using themes include:
  • This allows you to build applications which are easily customized by a third party
  • You can compute the styling by requested device/language type/browser type, so you can tailor your site to the user's browsing device.
  • Core and developer component styling can be globally controlled (no need to set style information or class) eg buttons across all nsf's can be the same style – and one place edits this

Examples of ways to use themes


Here are some relevant examples for themes:
  • Importing Resources (custom.css from nsf)

  • sectVI_code3.png
  • Styling Core Controls that have no Theme id's

  • sectVI_code4.png
  • Styling controls with Theme ids
You provide an element/control with a theme id, then refer to that id in your theme document which then assigns the styling. The benefit of doing this is having more global control and making it easy for others to provide customization's.

Here is an example of the code:
sectVI_code5.png

The illustration below shows the naming of the ThemeID within the AllProperties panel.

sectVI_26.png

Extended use of themes


Themes can control more than styling, there are other properties can be set/overridden. For example a page title can be set within a theme file
sectVI_code6.png

Style Classes can be set depending on scoped variables
sectVI_code7.png

Back to Top

Reuse of current Domino code


Building new applications is more fun, but we can also quickly provide old applications with a new lease of life with XPages
Things to consider:
  • Bookmarks to existing web pages. The XPage url is different for pages and views
  • Lotusscript is not currently supported in XPages directly - you may want to use existing Lotuscript logic to process data
  • You can mix/match standard Domino and XPage design elements, however you cannot do things like re-use subforms in XPages – so you will need to recreate as a custom control

Note - Please refer to the section of the wiki for Sample Application 1 - Modernizing existing Notes Applications - Converting an existing Notes Application into an XPage application.

URLs


Forms can be marked to launch the document instead using a selected XPage. Accordingly, if a user has a bookmark to an existing view/document url internally, the XPages code will redirect to the XPage url. The setting is in Form Properties, second tab “Display Xpage instead”, as shown in the image below. This is used in the Domino Wiki Template Form “Content” so the wiki template is backwards compatible with a standard Domino version.

sectVI_27.png

Reusing Existing LotusScript Logic


You may currently have a lot of logic sitting in Lotusscript agents or libraries, and you want to use these when using XPages.While in the long term, using the XPages way of doing things is probably better, and there will hopefully continue to be improvements in this area soon, there is a way of leveraging say LotusScript based webQuerySave agents or script libraries.

You can do this by using the agent.RunOnServer(docid) command (as when the agent executes, we do not have the usual documentcontext handle) to run your agent after an XPage document save. The difference to note, is when you perform any actions on the document (via your code), it has already been saved, so you are not able to do anything before save. (Tthese are the actions you will need to write in XPages javascript).

You can see this working in the wiki template custom control “prtContent”. The postSaveDocument code calls the agent “XPSavePage”.

sectVI_28.png

To do this you would create an agent as normal, and instead of collecting the document reference via session.documentContext, instead use agent.ParameterDocID via Set doc = db.GetDocumentByID(agent.ParameterDocID):

sectVI_29.png

Then in your XPage, navigate to "Events > Data > Your Document as specified already as a data source > postSaveDocument" add an action "Basic > Execute Script". You can then use the code var agent=database.getAgent("youragent"); to get a handle to the agent and then agent.runOnServer(document1.getNoteID()); to pass the document reference to your agent (which we collected using agent.ParameterDocID).

sectVI_30.png

sectVI_31.png

Use Web Site Rule Substitution


If you have a particular agent or view that takes url parameters and you want to preserve the url, but rewrite using an XPage, a Site Substitution rule could help you. Just add a new Web Site Rule to the server address book under Web / Internet Sites.

For example: to change from: notesini.nsf/use?openview&cat=* to notesini.nsf/xpViewCategories.xsp?lookupName=*, but keep the ability to pass a parameter over.

sectVI_32.png

Note - See the article How can I open documents in a traditional Form rather than an XPage from a viewpanel? for more information.

Back to Top

Active Content Filtering ACF


Uses a pure Java open source engine that is bundled with XPages/Domino. It can automatically Filters nasty html or JavaScript embedded within rich text or fields. You can switch it on through the All Properties and “htmlFilter” or “htmlFilterIn”. The setting “acf” will do a full filter while “striptags” will strip html tags only.

sectVI_33.png

Client Side JavaScript


You can on the Client Side reference server side code
tmp="#{serverScope.variable}" or tmp="#{javascript:@DbName()}"

Client Side object location:
var o=document.getElementById("#{id:Name}");

Getting id of element:
"#{id:elementName}"

Server Side JavaScript SSJS


Full XSP and Domino object model
Can embed @Formula language within your code
Server Side object location:
o=getComponent("Name");

Adding Java to template and build path


Goto java perspective and navigate to WebContent/WEB-INF.

sectVI_34.png

Now Right Mouse click on WEB-INF - New Folder (name folder say src). Then go to Project > Properties > Java Build Path > Source > Add Folder. Select the WebContent>WEB-INF>src folder - and Click ok. Create new package Inside Local > your new folder

sectVI_35.png

Using Pure Java within SSJS


You can build java classes within the java perspective of Eclipse/Designer and import them into your SSJS for use

ImportPackage (package) will do the import

sectVI_36.png

Back to Top

Note - Special thanks to Steve Castledine and Peter Janzen for their help with this content

expanded Article information
collapsed Article information
Category:
IBM Redbooks: Building Domino Web Applications using Domino 8.5.1
Tags:

This Version: Version 2 January 15, 2010 10:40:11 AM by John Bergland  IBMer

expanded Attachments (45)
collapsed Attachments (45)

 


File TypeSizeFile NameCreated On
image/x-png 1 KB backtotop.png 1/15/10 10:46 AM
image/x-png 15 KB sectVI_36.png 1/15/10 10:46 AM
image/x-png 33 KB sectVI_33.png 1/15/10 10:46 AM
image/x-png 4 KB sectVI_34.png 1/15/10 10:46 AM
image/x-png 14 KB sectVI_35.png 1/15/10 10:46 AM
image/x-png 15 KB sectVI_32.png 1/15/10 10:46 AM
image/x-png 13 KB sectVI_26.png 1/15/10 10:46 AM
image/x-png 11 KB sectVI_27.png 1/15/10 10:46 AM
image/x-png 18 KB sectVI_28.png 1/15/10 10:46 AM
image/x-png 5 KB sectVI_29.png 1/15/10 10:46 AM
image/x-png 15 KB sectVI_30.png 1/15/10 10:46 AM
image/x-png 8 KB sectVI_31.png 1/15/10 10:46 AM
image/x-png 11 KB sectVI_25.png 1/15/10 10:46 AM
image/x-png 20 KB sectVI_20.png 1/15/10 10:46 AM
image/x-png 12 KB sectVI_21.png 1/15/10 10:46 AM
image/x-png 5 KB sectVI_22.png 1/15/10 10:46 AM
image/x-png 9 KB sectVI_23.png 1/15/10 10:46 AM
image/x-png 2 KB sectVI_24.png 1/15/10 10:46 AM
image/x-png 26 KB sectVI_code7.png 1/15/10 10:46 AM
image/x-png 6 KB sectVI_code6.png 1/15/10 10:46 AM
image/x-png 6 KB sectVI_code5.png 1/15/10 10:46 AM
image/x-png 9 KB sectVI_code4.png 1/15/10 10:46 AM
image/x-png 3 KB sectVI_code3.png 1/15/10 10:46 AM
image/x-png 9 KB sectVI_19.png 1/15/10 10:46 AM
image/x-png 6 KB sectVI_14.png 1/15/10 10:46 AM
image/x-png 35 KB sectVI_15.png 1/15/10 10:46 AM
image/x-png 3 KB sectVI_16.png 1/15/10 10:46 AM
image/x-png 7 KB sectVI_17.png 1/15/10 10:46 AM
image/x-png 15 KB sectVI_18.png 1/15/10 10:46 AM
image/x-png 3 KB sectVI_code2.png 1/15/10 10:46 AM
expanded Versions (2)
collapsed Versions (2)
Version Comparison     
Version Date Changed by               Summary of changes
18 Jan 14, 2010 9:59:03 PM John Bergland  
This version (2) Jan 15, 2010 10:40:11 AM John Bergland  
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