- public Object format(DataProvider dataProvider, Object data, Map<String, String> parameters) {
- Request request = (Request) data;
- String name = parameters.get("name");
- String nameKey = parameters.get("nameKey");
- if (nameKey != null) {
- name = String.valueOf(dataProvider.getData(nameKey));
- }
- String key = parameters.get("key");
- String value = null;
- if (key != null) {
- value = String.valueOf(dataProvider.getData(key));
- }
- if (value == null) {
- value = parameters.get("value");
- }
- if (value == null) {
- return request.getUri();
- }
+ public Object format(TemplateContext templateContext, Object data, Map<String, Object> parameters) {
+ FreenetRequest request = (FreenetRequest) data;
+ String name = String.valueOf(parameters.get("name"));
+ String value = String.valueOf(parameters.get("value"));