endVersionable((ImportNodeData) getParent(), parseValues());
}
else
{
ImportNodeData currentNodeInfo = (ImportNodeData) getParent();
List<ValueData> values = parseValues();
// determinating is property multivalue;
boolean isMultivalue = true;
PropertyDefinitionDatas defs =
nodeTypeDataManager.findPropertyDefinitions(propertyInfo.getName(), currentNodeInfo
.getPrimaryTypeName(), currentNodeInfo.getMixinTypeNames());
if (defs == null)
{
if (!((Boolean) context.get(ContentImporter.RESPECT_PROPERTY_DEFINITIONS_CONSTRAINTS)))
{
log.warn("Property definition not found for " + propertyInfo.getName());
return null;
}
else
throw new RepositoryException("Property definition not found for " + propertyInfo.getName());
}
if (values.size() == 1)
{
// there is single-value defeniton
if (defs.getDefinition(false) != null)
{
isMultivalue = false;
}
}
else
{
if ((defs.getDefinition(true) == null) && (defs.getDefinition(false) != null))
{
throw new ValueFormatException("Can not assign multiple-values " + "Value to a single-valued property "
+ propertyInfo.getName().getName());
}
}
log.debug("Import " + propertyInfo.getName().getName() + " size=" + propertyInfo.getValuesSize()
+ " isMultivalue=" + isMultivalue);
propertyData =
new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()),
propertyInfo.getIndentifer(), 0, propertyInfo.getType(), currentNodeInfo.getIdentifier(),
isMultivalue);
propertyData.setValues(values);
}
return propertyData;