* @param defaultNodeNameGenerator a default generator
* @return a nice node name
*/
public String getNodeName(SlingHttpServletRequest request, String basePath,
boolean requirePrefix, NodeNameGenerator defaultNodeNameGenerator) {
RequestParameterMap parameters = request.getRequestParameterMap();
String valueToUse = null;
boolean doFilter = true;
// find the first request parameter that matches one of
// our parameterNames, in order, and has a value
if (parameters!=null) {
// we first check for the special sling parameters
RequestParameter specialParam = parameters.getValue(SlingPostConstants.RP_NODE_NAME);
if ( specialParam != null ) {
if ( specialParam.getString() != null && specialParam.getString().length() > 0 ) {
valueToUse = specialParam.getString();
doFilter = false;
}
}
if ( valueToUse == null ) {
specialParam = parameters.getValue(SlingPostConstants.RP_NODE_NAME_HINT);
if ( specialParam != null ) {
if ( specialParam.getString() != null && specialParam.getString().length() > 0 ) {
valueToUse = specialParam.getString();
}
}
}
if (valueToUse == null) {
for (String param : parameterNames) {
if (valueToUse != null) {
break;
}
if (requirePrefix) {
param = SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT.concat(param);
}
final RequestParameter[] pp = parameters.get(param);
if (pp != null) {
for (RequestParameter p : pp) {
valueToUse = p.getString();
if (valueToUse != null && valueToUse.length() > 0) {
break;