<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">

	<channel>
		<title>XSnippets</title>
		<description>OpenNTF XSnippets Feed</description>
		<link>http://openntf.org/xsnippets</link>
		<atom:link rel="self" type="application/rss+xml" href="http://openntf.org/xsnippets/feedRecentAll.xsp?format=rss&amp;count=40" />
		<lastBuildDate>Tue, 15 May 2012 07:01:36 -0500</lastBuildDate>
		<item>
			<title>Replace leading ZEROS from String</title>
			<link>http://openntf.org/s/replace-leading-zeros-from-string</link>
			<guid>http://openntf.org/s/replace-leading-zeros-from-string</guid>
			<pubDate>Tue, 15 May 2012 07:01:36 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Replace leading ZEROS from String</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>Remove the leading zeros in alphanumeric text]]>
			</content:encoded>
		</item>

		<item>
			<title>Access Redmine via sbt.GenericService</title>
			<link>http://openntf.org/s/access-redmine-via-sbt.genericservice</link>
			<guid>http://openntf.org/s/access-redmine-via-sbt.genericservice</guid>
			<pubDate>Tue, 15 May 2012 01:15:33 -0500</pubDate>
			<dc:creator>Niklas Heidloff</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Access Redmine via sbt.GenericService</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XML snippet. Created by Niklas Heidloff</div><hr/>This snippet shows how to read a list of issues from Redmine. It shows how to use the sbt.GenericService API that is part of the com.ibm.xsp.extlibx.sbt plugin from the extlib. Note that you could also use the restXmlData source to get benefits like caching.]]>
			</content:encoded>
		</item>

		<item>
			<title>Access StackOverflow via restJsonData Source</title>
			<link>http://openntf.org/s/access-stackoverflow-via-restjsondata-source</link>
			<guid>http://openntf.org/s/access-stackoverflow-via-restjsondata-source</guid>
			<pubDate>Tue, 15 May 2012 01:10:59 -0500</pubDate>
			<dc:creator>Niklas Heidloff</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Access StackOverflow via restJsonData Source</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XML snippet. Created by Niklas Heidloff</div><hr/>This displays the latest questions tagged with xpages from StackOverflow.

You need an app key from StackOverflow and this code requires com.ibm.xsp.extlibx.sbt from the extlib.

The code also shows the busy indicator when reading the data. Plus it shows how to do caching. Only every three minutes the data is read from StackOverflow. In the meantime XPages returns the cached information.]]>
			</content:encoded>
		</item>

		<item>
			<title>OneUI Application Layout Custom Control</title>
			<link>http://openntf.org/s/oneui-application-layout-custom-control</link>
			<guid>http://openntf.org/s/oneui-application-layout-custom-control</guid>
			<pubDate>Mon, 14 May 2012 08:57:34 -0500</pubDate>
			<dc:creator>Jakob Majkilde</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">OneUI Application Layout Custom Control</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Jakob Majkilde</div><hr/>If you don't use Extension Library, then this 'Layout' custom control might be handy.
Installation:
1. Copy all into a new Custom Control
2. Delete or hide (loaded=falase) elements you don't want to use
3. Use a OneUI theme, e.g. oneuiv2.1_blue
4. Add these css settings to your stylesheet
	.lotusSection h2 {margin:0px;}
	.lotusTitleBar h2 {	margin:0px;	font-weight: bold;}
	.lotusPlaceBar h2 {	margin:0px;}
5. OneUI 2.1 documentation: http://infolib.lotus.com/resources/oneui/2.1/docPublic/index.htm]]>
			</content:encoded>
		</item>

		<item>
			<title>boolean isParsableToInt(String i)</title>
			<link>http://openntf.org/s/boolean-isparsabletointstring-i</link>
			<guid>http://openntf.org/s/boolean-isparsabletointstring-i</guid>
			<pubDate>Sun, 13 May 2012 01:57:15 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">boolean isParsableToInt(String i)</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>@param s String, string value to check
@return boolean true|false


Sample:

isParsableToInt("A") returns false
isParsableToInt("12345") returns true]]>
			</content:encoded>
		</item>

		<item>
			<title>Convert long to String</title>
			<link>http://openntf.org/s/convert-long-to-string</link>
			<guid>http://openntf.org/s/convert-long-to-string</guid>
			<pubDate>Fri, 11 May 2012 01:01:22 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Convert long to String</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>3 ways to convert from long to String in Java]]>
			</content:encoded>
		</item>

		<item>
			<title>Display XPages as iWidgets in fullpage Mode in Connections</title>
			<link>http://openntf.org/s/display-xpages-as-iwidgets-in-fullpage-mode-in-connections</link>
			<guid>http://openntf.org/s/display-xpages-as-iwidgets-in-fullpage-mode-in-connections</guid>
			<pubDate>Thu, 10 May 2012 00:46:14 -0500</pubDate>
			<dc:creator>Niklas Heidloff</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Display XPages as iWidgets in fullpage Mode in Connections</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XML snippet. Created by Niklas Heidloff</div><hr/>This snippet shows how to display XPages as iWidgets in fullpage mode in IBM Connections. See http://heidloff.net/home.nsf/dx/09.05.2012091955NHEALZ.htm for details.

The snippet solves two issues:
1. In Domino 8.5.3 neither Designer, nor the XPages runtime can handle the fullpage mode out of the box
2. Since the XPage is displayed in an iFrame extra code needs to be written to handle the automatic resizing

Here is a short video showing it in action: heidloff.net/home.nsf/dx/ResizeXPageIWidget.mov/$file/ResizeXPageIWidget.mov

I've tested this in Domino 8.5.3, Connections 3.0.1 and the latest versions of FF, Chrome and Safari.
]]>
			</content:encoded>
		</item>

		<item>
			<title>Advanced Custom Input Conversion: Failover during PROCESS_VALIDATIONS phase before Validators run</title>
			<link>http://openntf.org/s/advanced-custom-input-conversion-failover-during-process_validations-phase-before-validators-run</link>
			<guid>http://openntf.org/s/advanced-custom-input-conversion-failover-during-process_validations-phase-before-validators-run</guid>
			<pubDate>Wed, 9 May 2012 08:26:59 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Advanced Custom Input Conversion: Failover during PROCESS_VALIDATIONS phase before Validators run</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Apply this pattern for provision of custom Java Converters.  Note during the PROCESS_VALIDATIONS phase, Converters are executed before Validators.  Therefore, for any given component with a Converter and Validators, a conversion failure will stop validation occurring and failover into the RENDER_RESPONSE phase to warn of the conversion issues.]]>
			</content:encoded>
		</item>

		<item>
			<title>Simple Custom Input Conversion: Failover during PROCESS_VALIDATIONS phase before Validators execute</title>
			<link>http://openntf.org/s/simple-custom-input-conversion-failover-during-process_validations-phase-before-validators-execute</link>
			<guid>http://openntf.org/s/simple-custom-input-conversion-failover-during-process_validations-phase-before-validators-execute</guid>
			<pubDate>Wed, 9 May 2012 08:18:48 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Simple Custom Input Conversion: Failover during PROCESS_VALIDATIONS phase before Validators execute</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Apply this pattern for provision of custom inline SSJS conversion.  Note during the PROCESS_VALIDATIONS phase, Convertors are executed before Validators.  Therefore, for any given component with a Convertor and Validators, a conversion failure will stop validation occurring and failover into the RENDER_RESPONSE phase to warn of the conversion issues.]]>
			</content:encoded>
		</item>

		<item>
			<title>Custom Error Page c/w Cause and Stacktrace Information</title>
			<link>http://openntf.org/s/custom-error-page-cw-cause-and-stacktrace-information</link>
			<guid>http://openntf.org/s/custom-error-page-cw-cause-and-stacktrace-information</guid>
			<pubDate>Tue, 8 May 2012 15:27:00 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Custom Error Page c/w Cause and Stacktrace Information</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Use this snippet to create a custom error XPage.  Remember to set the Error Page in the Application Properties to point at your new custom error XPage.

If an exception occurs in your application, you'll see error output in the custom error page like this example:


An error has occurred:

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression In the control : computedField7 At line 1, column 19 of: #{javascript:nonexistentObject.isDebugMode()}

com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
javax.faces.component.UIOutput.getValue(UIOutput.java:159)
com.ibm.xsp.util.FacesUtil.convertValue(FacesUtil.java:1120)
com.ibm.xsp.renderkit.html_basic.OutputTextRenderer.encodeEnd(OutputTextRenderer.java:97)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeEnd(ReadOnlyAdapterRenderer.java:180)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:1005)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:856)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.component.UIViewRootEx._renderView(UIViewRootEx.java:1317)
com.ibm.xsp.component.UIViewRootEx.renderView(UIViewRootEx.java:1255)
com.ibm.xsp.application.ViewHandlerExImpl.doRender(ViewHandlerExImpl.java:641)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:320)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:335)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:264)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:248)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:205)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:661)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:481)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)]]>
			</content:encoded>
		</item>

		<item>
			<title>class DateHelper</title>
			<link>http://openntf.org/s/class-datehelper</link>
			<guid>http://openntf.org/s/class-datehelper</guid>
			<pubDate>Sun, 6 May 2012 02:48:06 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">class DateHelper</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>A class to handle Dates in Java. It includes some advanced methods]]>
			</content:encoded>
		</item>

		<item>
			<title>DateHelper: isValidDate(String dt)</title>
			<link>http://openntf.org/s/datehelper-isvaliddatestring-dt</link>
			<guid>http://openntf.org/s/datehelper-isvaliddatestring-dt</guid>
			<pubDate>Sun, 6 May 2012 01:35:55 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">DateHelper: isValidDate(String dt)</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>A simple class to determine, if a Date that is passed as a String is a valid Date according to a DateFormatPattern

Sample:

public class DateCheck {

 
  public static void main(String[] args) {
	  DateHelper dh = new DateHelper();
    System.out.println(dh.isValidDate("2004/02/29"));
    System.out.println(dh.isValidDate("21.10.1959"));
  }
  
}

returns 
false
true

because the first String does not match the locale DateFormatParrten dd.MM.yyyy
]]>
			</content:encoded>
		</item>

		<item>
			<title>getNextBusinessDay(int offset, Date baseDate, int[] excludedDaysOfWeek, String[] excludedDateList)</title>
			<link>http://openntf.org/s/getnextbusinessdayint-offset-date-basedate-int-excludeddaysofweek-string-excludeddatelist</link>
			<guid>http://openntf.org/s/getnextbusinessdayint-offset-date-basedate-int-excludeddaysofweek-string-excludeddatelist</guid>
			<pubDate>Sat, 5 May 2012 07:38:16 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">getNextBusinessDay(int offset, Date baseDate, int[] excludedDaysOfWeek, String[] excludedDateList)</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>	/**
	 * Use to find out what date is a certain number of days after a base date,
	 * not counting certain days of the week and certain dates ( company holiday etc ).
	 * 
	 * @param offset
	 *            Number of non-excluded days from the baseDate that the result
	 *            date will be
	 * @param baseDate
	 *            Date to start counting offset from. If specify "null" defaults
	 *            to today
	 * @param excludedDaysOfWeek
	 *            Array of constants from java.util.Calendar object e.g.
	 *            Calendar.SUNDAY, which are excluded from counting towards
	 *            offset for the result
	 * @param excludedDateList
	 *            Array of date strings (formatted as
	 *            <CODE>SimpleDateFormat.getDateInstance().format(</CODE>))
	 *            which represent specific dates which should be excluded from
	 *            the counting of days, such as holidays
	 * @return The earliest date which is offset days after the baseDate. In
	 *         counting towards this result date, any excludedDaysOfWeek and excludedDates are
	 *         excluded from counting towards the offset
	 */]]>
			</content:encoded>
		</item>

		<item>
			<title>getWorkDays(Date startDt, Date endDt)</title>
			<link>http://openntf.org/s/getworkdaysdate-startdt-date-enddt</link>
			<guid>http://openntf.org/s/getworkdaysdate-startdt-date-enddt</guid>
			<pubDate>Sat, 5 May 2012 03:25:01 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">getWorkDays(Date startDt, Date endDt)</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>A simple method to calculate the number of workDays between two dates. Saturday and Sunday are automatically excluded as workingDays. ]]>
			</content:encoded>
		</item>

		<item>
			<title>Sample VariableResolver</title>
			<link>http://openntf.org/s/sample-variableresolver</link>
			<guid>http://openntf.org/s/sample-variableresolver</guid>
			<pubDate>Fri, 4 May 2012 06:46:55 -0500</pubDate>
			<dc:creator>Paul S Withers</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Sample VariableResolver</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XML snippet. Created by Paul S Withers</div><hr/>Sample VariableResolver. The XPage reference to showRow looks to the variableResolver and calls the resolveVariable method, passing showRow as the String name parameter. The if statement is matched so returns true.
Multiple if statements can be included. A variableResolver could map to a fixed value, as here, the outcome of a Java method or to a database (like the "database" Global Object). In tests, a variableResolver performed much better than SSJS and better than calling a managed bean (via EL or SSJS).]]>
			</content:encoded>
		</item>

		<item>
			<title>Cancel Partial Refresh</title>
			<link>http://openntf.org/s/cancel-partial-refresh</link>
			<guid>http://openntf.org/s/cancel-partial-refresh</guid>
			<pubDate>Thu, 3 May 2012 01:12:13 -0500</pubDate>
			<dc:creator>Sven Hasselbach</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Cancel Partial Refresh</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript (Server) snippet. Created by Sven Hasselbach</div><hr/>Cancel Partial Refresh via SSJS

Function cancels a partial refresh and prevents client to refresh the DOM tree.
Thanks to Philippe Riand for his assistance!

More details can be found here:
http://hasselba.ch/blog/?p=694
http://hasselba.ch/blog/?p=683

Tested on 8.5.3.

Here is an example XPage that shows how to use the code:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
   <xp:button value="Label" id="button1">
      <xp:eventHandler event="onclick" submit="true"
         refreshMode="partial" refreshId="label1">
      </xp:eventHandler>
   </xp:button>
   <xp:br/><xp:br/>
   <xp:label id="label1">
      <xp:this.value>
      <![CDATA[#{javascript:
      function cancelPartialRefresh(){
         var response = facesContext.getExternalContext()
            .getResponse();
         response.setHeader("X-XspRefreshId", "@none");
         response.reset();
         response.commitResponse();
         facesContext.responseComplete();
      }

      var ajax = new com.ibm.xsp.ajax.AjaxUtil();
      if( ajax.isAjaxPartialRefresh(facesContext) == true){
         cancelPartialRefresh();
         return; // stop execution of SSJS code
      }
      java.lang.System.currentTimeMillis();}
      </xp:this.value>
   </xp:label>
</xp:view>
]]>
			</content:encoded>
		</item>

		<item>
			<title>Add HTML to Xpages RichText Field</title>
			<link>http://openntf.org/s/add-html-to-xpages-richtext-field</link>
			<guid>http://openntf.org/s/add-html-to-xpages-richtext-field</guid>
			<pubDate>Wed, 2 May 2012 15:28:50 -0500</pubDate>
			<dc:creator>mark t hughes</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Add HTML to Xpages RichText Field</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript (Client) snippet. Created by mark t hughes</div><hr/>]]>
			</content:encoded>
		</item>

		<item>
			<title>Compare dates</title>
			<link>http://openntf.org/s/compare-dates</link>
			<guid>http://openntf.org/s/compare-dates</guid>
			<pubDate>Mon, 30 Apr 2012 08:05:11 -0500</pubDate>
			<dc:creator>Per Henrik Lausten</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Compare dates</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript (Server) snippet. Created by Per Henrik Lausten</div><hr/>This simple snippet shows how to compare dates using the java.util.Date compareTo method. The example assumes that an inputText field with a dateTimeHelper called Date exists.]]>
			</content:encoded>
		</item>

		<item>
			<title>@URLEncode and @URLDecode / extension to the extension Library</title>
			<link>http://openntf.org/s/urlencode-and-urldecode-extension-to-the-extension-library</link>
			<guid>http://openntf.org/s/urlencode-and-urldecode-extension-to-the-extension-library</guid>
			<pubDate>Mon, 30 Apr 2012 03:19:37 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">@URLEncode and @URLDecode / extension to the extension Library</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>This is the source code that can be used to build a plugin that adds two new @formulas that can be used in SSJS]]>
			</content:encoded>
		</item>

		<item>
			<title>Get Information on all network adapters</title>
			<link>http://openntf.org/s/get-information-on-all-network-adapters</link>
			<guid>http://openntf.org/s/get-information-on-all-network-adapters</guid>
			<pubDate>Sun, 29 Apr 2012 23:12:40 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Get Information on all network adapters</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>This is a quick and dirty solution to retrieve some information on all installed network interfaces ( Hostname, IP, MAC Address )

i.e.

-------------------------
DisplayName : Atheros AR8151 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
HostName : castor
IP Address : 192.168.178.52
MAC address : 04-7D-7B-79-3D-5C
-------------------------]]>
			</content:encoded>
		</item>

		<item>
			<title>Xpages iFrame for JFreeChart (Notes Form)</title>
			<link>http://openntf.org/s/xpages-iframe-for-jfreechart-notes-form</link>
			<guid>http://openntf.org/s/xpages-iframe-for-jfreechart-notes-form</guid>
			<pubDate>Sat, 28 Apr 2012 10:11:17 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Xpages iFrame for JFreeChart (Notes Form)</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Köll S Cherizard</div><hr/>Use this XSnippet to compliment the LotusScript added last night, reading Java(Script) that in fact loads the bar chart.  In this case the LotusScript code is moved to an Agent and is running as a List from Agent properties, and is given public access to all (*not recommended if using forms with sensitive data.)...]]>
			</content:encoded>
		</item>

		<item>
			<title>Server-side Value Change Events / Listeners</title>
			<link>http://openntf.org/s/server-side-value-change-events-listeners</link>
			<guid>http://openntf.org/s/server-side-value-change-events-listeners</guid>
			<pubDate>Sat, 28 Apr 2012 06:15:07 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Server-side Value Change Events / Listeners</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Example illustrating use of a valueChangeListener by way of a Managed Bean method.]]>
			</content:encoded>
		</item>

		<item>
			<title>Java Listens to LotusScript, Runs JFreeChart</title>
			<link>http://openntf.org/s/java-listens-to-lotusscript-runs-jfreechart</link>
			<guid>http://openntf.org/s/java-listens-to-lotusscript-runs-jfreechart</guid>
			<pubDate>Fri, 27 Apr 2012 20:04:08 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Java Listens to LotusScript, Runs JFreeChart</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Köll S Cherizard</div><hr/>This XSnippet is not much different than an earlier one added, except that this one runs as a Java *Script Library to work in conjunction with LotusScript code on a form to access the JFreeChart Engine and build us a bar chart into user's Explorer window.]]>
			</content:encoded>
		</item>

		<item>
			<title>LotusScript Tells Java Run JFreeChart</title>
			<link>http://openntf.org/s/lotusscript-tells-java-run-jfreechart</link>
			<guid>http://openntf.org/s/lotusscript-tells-java-run-jfreechart</guid>
			<pubDate>Fri, 27 Apr 2012 19:59:27 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">LotusScript Tells Java Run JFreeChart</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">LotusScript snippet. Created by Köll S Cherizard</div><hr/>Code amassed through recycled information, results being readied to load to Xpages; this should be straight forward, adding the Java(Script) Lib that goes with this in a few...]]>
			</content:encoded>
		</item>

		<item>
			<title>Advanced Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</title>
			<link>http://openntf.org/s/advanced-custom-input-validation-failover-during-process_validations-phase</link>
			<guid>http://openntf.org/s/advanced-custom-input-validation-failover-during-process_validations-phase</guid>
			<pubDate>Fri, 27 Apr 2012 06:28:43 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Advanced Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Advanced example illustrating use of a dedicated Validator class.  When the submitted value is not as expected, the PROCESS_VALIDATIONS phase will failover to the RENDER_RESPONSE phase.]]>
			</content:encoded>
		</item>

		<item>
			<title>Intermediate Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</title>
			<link>http://openntf.org/s/intermediate-custom-input-validation-failover-during-process_validations-phase</link>
			<guid>http://openntf.org/s/intermediate-custom-input-validation-failover-during-process_validations-phase</guid>
			<pubDate>Fri, 27 Apr 2012 04:23:59 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Intermediate Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Intermediate example illustrating use of a Managed Bean with a validation method.  When the submitted value is not as expected, the PROCESS_VALIDATIONS phase will failover to the RENDER_RESPONSE phase.]]>
			</content:encoded>
		</item>

		<item>
			<title>Simple Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</title>
			<link>http://openntf.org/s/simple-custom-input-validation-failover-during-process_validations-phase</link>
			<guid>http://openntf.org/s/simple-custom-input-validation-failover-during-process_validations-phase</guid>
			<pubDate>Fri, 27 Apr 2012 02:24:18 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Simple Custom Input Validation: Failover during PROCESS_VALIDATIONS phase</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Simple example of providing a custom validation handler using SSJS.  When the length of the submitted value is greater than expected, an error message is queued in the FacesContext.  The validator state is then set to invalid which causes the XPages Request Processing Lifecycle to failover during Phase 3: PROCESS_VALIDATIONS.]]>
			</content:encoded>
		</item>

		<item>
			<title>Rich Text Editor: Toolbar Customization</title>
			<link>http://openntf.org/s/rich-text-editor-toolbar-customization</link>
			<guid>http://openntf.org/s/rich-text-editor-toolbar-customization</guid>
			<pubDate>Fri, 27 Apr 2012 01:59:43 -0500</pubDate>
			<dc:creator>Tony McGuckin</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Rich Text Editor: Toolbar Customization</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Tony McGuckin</div><hr/>Simple snippet illustrating toolbar customization of the Rich Text Editor (c/w 'Source' toolbar option).]]>
			</content:encoded>
		</item>

		<item>
			<title>ViewPanel.Disable.Header.Footer</title>
			<link>http://openntf.org/s/viewpanel.disable.header.footer</link>
			<guid>http://openntf.org/s/viewpanel.disable.header.footer</guid>
			<pubDate>Tue, 24 Apr 2012 23:55:14 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">ViewPanel.Disable.Header.Footer</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Themes snippet. Created by Ulrich Krause</div><hr/>Disables headers and footers in a ViewPanel when not used by a pager

Put this snippet into your theme and assign a themeId to to viewPanel that you want to hide header and footer 

		<xp:viewPanel rows="30" id="vp_contactsAll" var="view_contactsAll"
			themeId="ViewPanel.Disable.Header.Footer">
			<xp:this.data>
                           ...]]>
			</content:encoded>
		</item>

		<item>
			<title>XPages Compatible Dojo Dijit Dialog with Non-Closable option</title>
			<link>http://openntf.org/s/xpages-compatible-dojo-dijit-dialog-with-non-closable-option</link>
			<guid>http://openntf.org/s/xpages-compatible-dojo-dijit-dialog-with-non-closable-option</guid>
			<pubDate>Tue, 24 Apr 2012 09:26:56 -0500</pubDate>
			<dc:creator>Sven Hasselbach</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">XPages Compatible Dojo Dijit Dialog with Non-Closable option</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript (Client) snippet. Created by Sven Hasselbach</div><hr/>This dojo dialog is a extension of the existing dojo dialog from Jeremy Hodge: http://openntf.org/XSnippets.nsf/snippet.xsp?id=xpages-compatible-dojo-dijit-dialog
The dialog has a new method setCloseButtonDisabled() which prevents closing the dialog via <ESC> and hides the close icon if required.

Here is an example how to use in a XPage:

   <xp:panel id="dialog"
      dojoType="ch.hasselba.widget.NonClosableDialog">
         <xp:this.dojoAttributes>
            <xp:dojoAttribute name="title"
               value="#{javascript:'dialogTitle'}" />
            </xp:this.dojoAttributes>
   </xp:panel>

   <xp:scriptBlock id="scriptBlockNonClosableDialog">
      <xp:this.value><![CDATA[dojo.addOnLoad( function(){
         dijit.byId('#{id:dialog}').setCloseButtonDisabled( true );
         dijit.byId('#{id:dialog}').show(); } )
      </xp:this.value>
   </xp:scriptBlock>


]]>
			</content:encoded>
		</item>

		<item>
			<title>Determine all groups for a defined user</title>
			<link>http://openntf.org/s/determine-all-groups-for-a-defined-user</link>
			<guid>http://openntf.org/s/determine-all-groups-for-a-defined-user</guid>
			<pubDate>Tue, 24 Apr 2012 02:41:00 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Determine all groups for a defined user</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript snippet. Created by Ulrich Krause</div><hr/>The snippet will return all groups, the user is a member of. 

Originally posted by Nathan T. Freemann http://ntf.gbs.com/nathan/escape.nsf/d6plinks/NTFN-8TMHRP . So Nathan is the creator, I am the contributer
]]>
			</content:encoded>
		</item>

		<item>
			<title>Settings bean - parameterized method call from EL</title>
			<link>http://openntf.org/s/settings-bean-parameterized-method-call-from-el</link>
			<guid>http://openntf.org/s/settings-bean-parameterized-method-call-from-el</guid>
			<pubDate>Tue, 24 Apr 2012 01:05:34 -0500</pubDate>
			<dc:creator>Thimo Jansen</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Settings bean - parameterized method call from EL</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Thimo Jansen</div><hr/>This code allows you to call parameterized methods in a bean from EL. For example:

Settings.value['db_names']

This example will try to get the value for settings parameter 'db_names' from the Settings bean. It will do so via the innerclass SettingsMap.

As explained into more detail on http://blog.thimojansenit.nl/2012/04/settings-bean-parameterized-method-call.html]]>
			</content:encoded>
		</item>

		<item>
			<title>Java Grab CSV Data Load JFreeChart</title>
			<link>http://openntf.org/s/java-grab-csv-data-load-jfreechart</link>
			<guid>http://openntf.org/s/java-grab-csv-data-load-jfreechart</guid>
			<pubDate>Mon, 23 Apr 2012 10:45:10 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Java Grab CSV Data Load JFreeChart</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Köll S Cherizard</div><hr/>This XSnippet queries CSV data into Java Application, add results to JFreeChart Bar chart.  As usual, play around with it, not tested on actual servers, or too much locally; made a bit of effort to ensure no bugs are present though...  Enjoy!!!]]>
			</content:encoded>
		</item>

		<item>
			<title>Query CSV File from Java - Backing Bean</title>
			<link>http://openntf.org/s/query-csv-file-from-java-backing-bean</link>
			<guid>http://openntf.org/s/query-csv-file-from-java-backing-bean</guid>
			<pubDate>Sat, 21 Apr 2012 18:41:47 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Query CSV File from Java - Backing Bean</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Köll S Cherizard</div><hr/>Query CSV file into Java Application, add results to console.  To be honest, not too much testing on this one, play around with it, see what else you can do...  Will not post an Xpage this time, you can add under a button/link as you wish.  

Note: If you build a JavaAgent, you will not need the jdbc jar file, but from Project Explorer, you need the jar in the CLASSPATH, and it should be referenced via build path...  Also seems to work well having the jar in the /lib/ext directory in Notes.]]>
			</content:encoded>
		</item>

		<item>
			<title>Build CSV file from XML Data - Xpages</title>
			<link>http://openntf.org/s/build-csv-file-from-xml-data-xpages</link>
			<guid>http://openntf.org/s/build-csv-file-from-xml-data-xpages</guid>
			<pubDate>Sat, 21 Apr 2012 14:16:23 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Build CSV file from XML Data - Xpages</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Köll S Cherizard</div><hr/>You can now build CSV files from XML, data that can be used by your application in the making of charts and other types of reports.  This could be a good way to use SQL to perform queries against this file and attempt other tasks...]]>
			</content:encoded>
		</item>

		<item>
			<title>Build CSV file from XML Data - Bean</title>
			<link>http://openntf.org/s/build-csv-file-from-xml-data-bean</link>
			<guid>http://openntf.org/s/build-csv-file-from-xml-data-bean</guid>
			<pubDate>Sat, 21 Apr 2012 14:14:22 -0500</pubDate>
			<dc:creator>Köll S Cherizard</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Build CSV file from XML Data - Bean</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Köll S Cherizard</div><hr/>Load XML file from C Drive using Java, create a CSV file, staty tuned for Xpages that loads this item...]]>
			</content:encoded>
		</item>

		<item>
			<title>Replace attachment when uploading a new attachment</title>
			<link>http://openntf.org/s/replace-attachment-when-uploading-a-new-attachment</link>
			<guid>http://openntf.org/s/replace-attachment-when-uploading-a-new-attachment</guid>
			<pubDate>Fri, 20 Apr 2012 04:53:55 -0500</pubDate>
			<dc:creator>Sven Hasselbach</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Replace attachment when uploading a new attachment</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">JavaScript (Server) snippet. Created by Sven Hasselbach</div><hr/>This function will replace an existing attachment in a richtext item with a newly uploaded attachment.
Only one attachment will be left in the richtext item.

Just call the function in the SSJS code in a submit button: replaceAttachment( document1, 'fileUpload1' , 'Body' )

See here for more details:
http://stackoverflow.com/questions/9925666/replace-attachment-when-uploading-a-new-attachment


Here is an example XPage (without the function, you have to copy it by yourself to the button code):

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

   <xp:this.data>
      <xp:dominoDocument var="document1" formName="TestRT"
         action="editDocument" documentId="2D8A8AB0DD77C895C12579E4004E594A">
      </xp:dominoDocument>
   </xp:this.data>

   <xp:fileUpload id="fileUpload1" value="#{document1.Body}"></xp:fileUpload>
   <xp:br></xp:br>
   <xp:br></xp:br>
   <xp:fileDownload rows="30" id="fileDownload1" displayLastModified="false" value="#{document1.Body}"></xp:fileDownload>
   <xp:br></xp:br>
   <xp:br></xp:br>
   <xp:button value="Label" id="button1">
      <xp:eventHandler event="onclick" submit="true"
         refreshMode="complete" immediate="false" save="true">
            <xp:this.action>
               <![CDATA[#{javascript:replaceAttachment( document1, 'fileUpload1' , 'Body' )}
            </xp:this.action>
      </xp:eventHandler>
   </xp:button>

</xp:view>]]>
			</content:encoded>
		</item>

		<item>
			<title>Access .properties files</title>
			<link>http://openntf.org/s/access-.properties-files</link>
			<guid>http://openntf.org/s/access-.properties-files</guid>
			<pubDate>Fri, 20 Apr 2012 03:01:25 -0500</pubDate>
			<dc:creator>Ulrich Krause</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Access .properties files</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">Java snippet. Created by Ulrich Krause</div><hr/>
This is another method of accessing a .properties file located in the resources section of your application. I have already posted a method that accesses a resource bundle using the global variable name here http://openntf.org/XSnippets.nsf/snippet.xsp?id=access-resource-bundle-in-xpages-from-java

Unfortunately, the global variable seems not to be available, when you use an ObjectData from the extension Library as a datasource (at least that is, what I found).

To set the locale variable, you can use this snippet from Sven Hasselbach http://openntf.org/XSnippets.nsf/snippet.xsp?id=xpages-localization-setter]]>
			</content:encoded>
		</item>

		<item>
			<title>Login Dialog</title>
			<link>http://openntf.org/s/login-dialog</link>
			<guid>http://openntf.org/s/login-dialog</guid>
			<pubDate>Wed, 18 Apr 2012 15:18:11 -0500</pubDate>
			<dc:creator>Matthias Nicklisch</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Login Dialog</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Matthias Nicklisch</div><hr/>Simply embedd this code somewhere in your XPage to have your login screen put into a dojo dialog.
I always put it into a link list on top of the screen like in OneUI or in a menu or something.

For anonymous users, the login link will be displayed and for any authorized user the logout link will be displayed.
Looks a bit more beautiful and more modern than a new screen with the login mask showing up. Of course this is only helpful if the application allows unauthorized users to open at least the start page.

I recommend using a customized login mask, defined in domcfg.nsf, in this dialog.

http://mnicklisch.wordpress.com/2012/04/18/xsnippet-easy-menu-login-dialog/]]>
			</content:encoded>
		</item>

		<item>
			<title>Easy Menu Custom Control</title>
			<link>http://openntf.org/s/easy-menu-custom-control</link>
			<guid>http://openntf.org/s/easy-menu-custom-control</guid>
			<pubDate>Wed, 18 Apr 2012 15:05:50 -0500</pubDate>
			<dc:creator>Matthias Nicklisch</dc:creator>
			<content:encoded>
				<![CDATA[<div style="font-size:1.3em; font-weight:bold;">Easy Menu Custom Control</div><div style="font-size:0.8em; font-style:italic; color:gray;margin-bottom:10px;">XPages snippet. Created by Matthias Nicklisch</div><hr/>This is a small tool to integrate easily a fully customizable and configurable menu in your XPage.
You can define a picture for your menu button and also a picture which will be displayed on mouseover. You can leave the picture properties empty, so you can define your buttons using CSS-styles.
The whole menu is designable via CSS-styles, either directly in the code, like in the example above or in a seperate CSS file via the defined classes.
For defining the content of your menu, just pass a java.util.Vector with entries with the following structure via the menuEntries property:

[ButtonLabel]|[Link]

You can also use multiple menuEntry properties with the same structure to define it manually.

You can define the link in different ways. You cann define an URL like google.de or a full URL. Also you can define XPages, but you have put a / before the name, like this: /xpage1.xsp.
I had put that in a configuration document.

To make the customControl work, you have to add the following properties:

menuEntry - type String - String Editor - Allow multiple instances
menuItemPicture - type String - Image File Picker
menuItemPictureHover - type String - Image File Picker
menuEntries - type java.util.Vector - String Editor

I hope I didn't forgot something

http://mnicklisch.wordpress.com/2012/04/18/xsnippet-easy-menu-login-dialog/]]>
			</content:encoded>
		</item>

	</channel>
</rss>
