Commit 3af3ef9d authored by helene ortiz's avatar helene ortiz
Browse files

No commit message

No commit message
parent da3be72d
......@@ -593,31 +593,35 @@ public class PropertyManager {
Map<String, Property> childProperties = new HashMap<String, Property>();
XMLDynamicPropertyDescriptor xmlDynamicPropertyDescriptor = getDynamicPropertyDescriptor(command.getType(), parentPropertyName);
DynamicPropertyDescriptor dynamicPropertyDescriptor = PropertyDatabase.getInstance().getDynamicPropertyDescriptor(command.getServantId(), xmlDynamicPropertyDescriptor.getPropertyName());
if (dynamicPropertyDescriptor == null) {
// trying with parent name (in case of double dynamic properties)
dynamicPropertyDescriptor = PropertyDatabase.getInstance().getDynamicPropertyDescriptor(command.getServantId(), parentPropertyName);
}
if (dynamicPropertyDescriptor != null) {
int propertyId = PropertyDatabase.getInstance().getDynamicPropertyIdForServant(command.getServantId(), parentPropertyName);
if (propertyId < 0) {
System.err.println("Cannot get dynamic property " + parentPropertyName);
return null;
if (xmlDynamicPropertyDescriptor == null) {
// This can occur when using a settings file containing property names which have been changed (renamed properties)
PropertyNotFoundException e = new PropertyNotFoundException(parentPropertyName, command.getType(), command.getName(), getClass().getCanonicalName(), "createDynamicPropertiesForCommand", PluginType.COMMAND);
} else {
DynamicPropertyDescriptor dynamicPropertyDescriptor = PropertyDatabase.getInstance().getDynamicPropertyDescriptor(command.getServantId(), xmlDynamicPropertyDescriptor.getPropertyName());
if (dynamicPropertyDescriptor == null) {
// trying with parent name (in case of double dynamic properties)
dynamicPropertyDescriptor = PropertyDatabase.getInstance().getDynamicPropertyDescriptor(command.getServantId(), parentPropertyName);
}
List<Integer> ids = dynamicPropertyDescriptor.getIds();
for (int i = 0; i < ids.size(); i++) {
Property childProperty = PropertyFactory.getInstance().createProperty(command.getId(), ids.get(i), xmlDynamicPropertyDescriptor, true);
childProperty.setServerId(command.getServerId());
childProperties.put(childProperty.getName(), childProperty);
if (dynamicPropertyDescriptor != null) {
int propertyId = PropertyDatabase.getInstance().getDynamicPropertyIdForServant(command.getServantId(), parentPropertyName);
if (propertyId < 0) {
System.err.println("Cannot get dynamic property " + parentPropertyName);
return null;
}
List<Integer> ids = dynamicPropertyDescriptor.getIds();
for (int i = 0; i < ids.size(); i++) {
Property childProperty = PropertyFactory.getInstance().createProperty(command.getId(), ids.get(i), xmlDynamicPropertyDescriptor, true);
childProperty.setServerId(command.getServerId());
childProperties.put(childProperty.getName(), childProperty);
}
return childProperties;
}
return childProperties;
LOGGER.log(Level.SEVERE, "Unable to find description of dynamic property " + parentPropertyName + " for atomic command " + command.getType());
}
LOGGER.log(Level.SEVERE, "Unable to find description of dynamic property " + parentPropertyName + " for atomic command " + command.getType());
return null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment