final String messageSegment = completionMessage == null ? "" : "&" + "_" + MESSAGE + "=" + URLEncoder.encode(completionMessage);
final RequestContext context = request.getContext();
final ObjectAdapter object = MethodsUtils.findObject(context, objectId);
final String version = context.mapVersion(object);
final ObjectAction action = MethodsUtils.findAction(object, method);
final ActionContent parameterBlock = new ActionContent(action);
request.setBlockContent(parameterBlock);
request.pushNewBuffer();
request.processUtilCloseTag();
final String text = request.popBuffer();
final String[] parameters = parameterBlock.getParameters();
final String target;
/*
if (action.isContributed()) {
System.arraycopy(parameters, 0, parameters, 1, parameters.length - 1);
parameters[0] = request.getContext().mapObject(object, Scope.REQUEST);
target = request.getContext().mapObject(action.realTarget(object), Scope.REQUEST);
if (!action.hasReturn() && resultOverride == null) {
resultOverride = parameters[0];
}
} else {
target = StringEscapeUtils.escapeHtml(request.getContext().mapObject(object, Scope.INTERACTION));
}
*/
final ObjectAdapter[] objectParameters;
// TODO copied from ActionButton
//final ObjectAdapter target;
if (false /*action.isContributed() */) {
// objectParameters= null;
// System.arraycopy(parameters, 0, parameters, 1, parameters.length - 1);
// parameters[0] = request.getContext().mapObject(object, Scope.REQUEST);
// target = request.getContext().mapObject(action.realTarget(object), Scope.REQUEST);
// if (!action.hasReturn() && resultOverride == null) {
// resultOverride = parameters[0];
// }
} else {
objectParameters = new ObjectAdapter[parameters.length];
// target = object;
target = StringEscapeUtils.escapeHtml(request.getContext().mapObject(object, Scope.INTERACTION));
int i = 0;
for (final ObjectActionParameter spec : action.getParameters()) {
final ObjectSpecification type = spec.getSpecification();
if (parameters[i] == null) {
objectParameters[i] = null;
} else if (type.getFacet(ParseableFacet.class) != null) {
final ParseableFacet facet = type.getFacet(ParseableFacet.class);