Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
protected final void addParameter(Parameter p); 

public void setParameterValue(String key, Object value); 

public final Object getParameterValue(String key); 

public boolean isParameterRequired(String key); 

public boolean hasDependentParameters(String key); 
 

 

Metadata Function Definitions

 

public JDBCMetaData(); (Constructor) 

The following attributes should be set in the constructor: 

AttributeDescription

sourceName 

Text name for the DataSource. For example “Twitter Connector”. 

sourceCode 

A unique text code for the DataSource. For example “TWITTER_CONNECTOR”. 

driverName 

The text class name of the DataSource. For example “com.code.TwitterConnector” 

sourceType 

This should always be 

DBType.THIRDPARTY 

 

Example implementation:

Code Block
languagejava
public SkiTeamMetaData() { 

			super(); 

			sourceName = "Ski Team Source"; 
			sourceCode = "SKI_DATA_SOURCE"; 
			driverName = SkiTeamDataSource.class.getName(); 
			sourceType = DBType.THIRD_PARTY; 

} 
 

 

 

public void initialiseParameters(); 

This function is where parameters should be registered. Registered parameters will be displayed to the user when creating a connection with this DataSource. Use the function addParameter() to add required parameters. 

 

Example implementation: 

Code Block
languagejava
public void initialiseParameters() { 


		super.initialiseParameters(); 


		addParameter(new Parameter("HELP", "Connection Details", "Text", TYPE_NUMERIC, DISPLAY_STATIC_TEXT, null, true)); 


		Parameter p = new Parameter("URL", "1. Request Access PIN", "Connect to twitter to receive a PIN for data access",TYPE_UNKNOWN, DISPLAY_URLBUTTON, null, 		true); 
		p.addOption("BUTTONTEXT", "Request URL"); 
		p.addOption("BUTTONURL", "http://google.com"); 
		addParameter(p); 


		addParameter(new Parameter("PIN", "2. Enter PIN", "Enter the PIN recieved from Twitter", TYPE_NUMERIC, DISPLAY_TEXT_MED, null, true)); 


		p = new Parameter("POSTPIN", "3. Validate Pin", "Validate the PIN", TYPE_TEXT, DISPLAY_BUTTON, null, true); 
		p.addOption("BUTTONTEXT", "Validate PIN"); 
		addParameter(p); 


		addParameter(new Parameter("ACCESSTOKEN", "Access Token", "AccessToken that allows access to the Twitter API", TYPE_TEXT, DISPLAY_PASSWORD, null, true)); 


		addParameter(new Parameter("ACCESSTOKENSECRET", "Access Token Secret", "AccessToken Password that allows access to the Twitter API", TYPE_TEXT, DISPLAY_PASSWORD, null, true)); 


}