Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

In this method, you perform any additional processing or parameter injection that you need. You then add in the default set of parameters by making a call to the superclass. The following is an example that conditionally adds an extra parameter based on some data already in the launch data map, lowercases another parameter, adds the default set of parameters and returns:

Code Block
borderStylesolid
titleSampleAdapter.javaborderStylesolid
public class SampleAdapter extends AbstractAdapter {

	@Override
	public Map<String, String> processLaunchData(Map<String, String> params) {

		log.debug("SampleAdapter.processLaunchData() called");

		//lowercase a parameter
		params.put("user_id", StringUtils.lowerCase(params.get("user_id")));

		//conditionally add new parameter
		if(Boolean.parseBoolean(params.get("some_boolean_param"))) {
			params.put("my_param", "My Special Parameter");
		}

		//add defaults
		params.putAll(super.getDefaultParameters());

		return params;
	}
}



...