mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- Fixed unreported bug where boolean deafult values where not set correctly
- Fixed AR-314, category rule was not appending additional categories - Fixed spelling mistake and moved lock messages into properties file while I was there (AWC-350) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2039 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,6 +40,7 @@ import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.InvalidAspectException;
|
||||
import org.alfresco.service.cmr.dictionary.InvalidTypeException;
|
||||
@@ -334,8 +335,32 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
{
|
||||
if (properties.containsKey(entry.getKey()) == false)
|
||||
{
|
||||
Serializable value = entry.getValue();
|
||||
|
||||
// TODO what other conversions are nessesary here for other types of default values ?
|
||||
|
||||
// Check the type of the default property
|
||||
PropertyDefinition prop = this.dictionaryService.getProperty(entry.getKey());
|
||||
if (prop != null)
|
||||
{
|
||||
if (DataTypeDefinition.BOOLEAN.equals(prop.getDataType().getName()) == true)
|
||||
{
|
||||
if (value instanceof String)
|
||||
{
|
||||
if (((String)value).toUpperCase().equals("TRUE") == true)
|
||||
{
|
||||
value = Boolean.TRUE;
|
||||
}
|
||||
else if (((String)value).toUpperCase().equals("FALSE") == true)
|
||||
{
|
||||
value = Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the default value of the property
|
||||
properties.put(entry.getKey(), entry.getValue());
|
||||
properties.put(entry.getKey(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user