Updates for NIHVIVO-3354 (default add missing individual and substitution of empty strings in object variables). Also updating edit request dispatch to forward to new edit dispatch controller before any additional processing in case the "oldEdit" parameter is not passed. Also removing mayEditAs.jsp.
This commit is contained in:
parent
a4f0f119c0
commit
a109868f34
5 changed files with 30 additions and 171 deletions
|
@ -86,7 +86,7 @@ public class EditN3GeneratorVTwo {
|
|||
|
||||
public String subInUris(String var, String value, String target) {
|
||||
// empty URIs get skipped
|
||||
if( var == null || var.isEmpty() || value == null || target == null)
|
||||
if( var == null || var.isEmpty() || value == null || value.isEmpty() || target == null)
|
||||
return target;
|
||||
|
||||
return subInNonBracketedURIS(var, "<" + value + ">", target);
|
||||
|
|
|
@ -355,9 +355,9 @@ public class ProcessRdfForm {
|
|||
}else{
|
||||
log.debug("no varNameForPredicate found in configuration");
|
||||
}
|
||||
|
||||
String varNameForObj = configuration.getVarNameForObject();
|
||||
if( varNameForObj != null && ! varNameForObj.isEmpty()){
|
||||
if( varNameForObj != null
|
||||
&& ! varNameForObj.isEmpty()){
|
||||
varToValue.put( varNameForObj, configuration.getObject());
|
||||
}else{
|
||||
log.debug("no varNameForObject found in configuration");
|
||||
|
|
|
@ -123,9 +123,8 @@ public class DefaultAddMissingIndividualFormGenerator implements EditConfigurati
|
|||
|
||||
private Map<String, String> generateNewResources(VitroRequest vreq) {
|
||||
HashMap<String, String> newResources = new HashMap<String, String>();
|
||||
//TODO: Get default namespace
|
||||
String defaultNamespace = vreq.getWebappDaoFactory().getDefaultNamespace();
|
||||
newResources.put(objectVarName, defaultNamespace + "individual");
|
||||
//Null triggers default namespace
|
||||
newResources.put(objectVarName, null);
|
||||
return newResources;
|
||||
}
|
||||
//Need to replace edit key
|
||||
|
@ -183,7 +182,11 @@ public class DefaultAddMissingIndividualFormGenerator implements EditConfigurati
|
|||
|
||||
private void initObjectParameters(VitroRequest vreq) {
|
||||
//in case of object property
|
||||
objectUri = EditConfigurationUtils.getObjectUri(vreq);
|
||||
String thisObjectUri = EditConfigurationUtils.getObjectUri(vreq);
|
||||
if(thisObjectUri != null && !thisObjectUri.isEmpty()) {
|
||||
objectUri = EditConfigurationUtils.getObjectUri(vreq);
|
||||
}
|
||||
//otherwise object uri will stay null - since don't want to set it to empty string
|
||||
}
|
||||
|
||||
//this particular form uses a different var name for object "newIndividual"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue