Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • Lotus Expeditor wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Lotus Expeditor 6.2.3 Documentation Custom Search Scope...
Search
Community Articles > Expeditor Client for Desktop > Sample: Variable Substitution
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorVan Staub
Contribution Summary:
  • Articles authored: 26
  • Articles edited: 13
  • Comments Posted: 4

Recent articles by this author

Sample: Toolbar and Menu Contributions

Expeditor user interface team best practices on toolbar and menu contributions

Sample: Component Properties

OverviewComponent properties allow developers to create code that at compile time has specific function but accepts flexible input at runtime. For example, a developer can create a component that uses a predefined component property to update the title tab's text within a composite ...

Sample: Multiuser Features

Overview When multiple users share the same workstation, the configuration is referred to as a multiuser installation. This means that a single Expeditor client exists and is shared among all users; however, each user has their own workspace containing configuration details specific to that ...

Sample: Starting Plugins

Overview By default, Eclipse plugins are lazy. Lazy is the technical term (located in the bundle's manifest) that means that plugins are started when a request is either directly made by the Platform to start the plugin or indirectly through class loading. For example, the latter case implies ...

Sample: HTTP Communication

Overview The enhanced HTTP client in Expeditor allows developers to quickly create code that requests data from remote servers over HTTP or HTTPS. The enhanced client wraps the standard Java URLConnectionclasses such that authenticated requests leverage the Accounts framework and HTTPS ...

Community articleSample: Variable Substitution

Added by IBM contributor Van Staub | Edited by IBM contributor Van Staub on May 12, 2011 | Version 6
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
This sample supplements the "Using Dynamic Variable Substitution in Composite Applications" found on the IBM Composite Applications Wiki.
Tags: samples
ShowTable of Contents
HideTable of Contents
  • 1 Overview
  • 2 Create the Extension
  • 3 Create the Substitution Logic
  • 4 Using Substitution

Overview


The Using Dynamic Variable Substitution in Composite Applications article demonstrates how variable substitution can be used during runtime to dynamically supply information to Composite Applications. This article demonstrates the extension point that allows substitution to occur.

Create the Extension


Add the org.eclipse.core.variables plugin to the dependency list. The org.eclipse.core.variables supplies the org.eclipse.core.variables.dynamicVariables extension point used to add your own variable substitution logic.

Extend and add your own substitution logic by adding the following extension.

<extension
         point="org.eclipse.core.variables.dynamicVariables">
      <variable
            description="Resolves variables for eclipse preferences.  The argument is of the format {$IBM:<pluginId>/<preferenceName>}."
            name="IBM"
            resolver="com.ibm.rcp.support.variables.dynamic.DynamicVariableResolver"
            supportsArgument="true">
      </variable>
   </extension>


Create the Substitution Logic


Next, implement the logic that will perform the substitution by implementing the IDynamicVariableResolver interface. This class should be referenced in the resolver element used in the extension described previously.

public class DynamicVariableResolver implements IDynamicVariableResolver {

	@Override
	public String resolveValue(IDynamicVariable variable, String argument)
			throws CoreException {

		String[] args = argument.split("/");

		// variables are of the form
		// {$IBM:<pluginId>/<preferenceName>}
		String plugin = args[0];
		String preference = args[1];

		// do some logic to substitute
		if (preference.equals("ibm_url")) {
			return "http://www.ibm.com";
		}

		return null;
	}
}


Using Substitution


Similar to the Using Dynamic Variable Substitution in Composite Applications, add a Managed Browser component to a Composite Application. Update the intialUrl component property to the value ${IBM:com.ibm.rcp.support.variable.dynamic/ibm_url}.



When the Managed Browser component initiatlizes, the substitution code will supply the http://www.ibm.com value.

  • Edit
  • More Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (6)
collapsed Versions (6)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (6)May 12, 2011 10:47:47 AMVan Staub  IBM contributor
5Nov 1, 2010 2:22:06 PMVan Staub  IBM contributor
4Nov 1, 2010 2:16:36 PMVan Staub  IBM contributor
3Nov 1, 2010 1:59:51 PMVan Staub  IBM contributor
2Nov 1, 2010 12:46:26 PMVan Staub  IBM contributor
1Nov 1, 2010 12:45:47 PMVan Staub  IBM contributor
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 ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use