cancel
Showing results for 
Search instead for 
Did you mean: 

Empty d:date fields & 'Bulk Filesystem Import Tool'...

oofdachile
Champ in-the-making
Champ in-the-making
Hi, folks –

I'm trying to import content using the 4.2.d "Bulk Filesystem Import Tool", but I'm having problems importing content whose corresponding metadata files contain empty values in non-mandatory metadata fields of d:date field type.  Alfresco Community 4.2.d complains that it doesn't understand how to translate these (empty) string values into dates:


org.alfresco.error.AlfrescoRuntimeException: 08230051 org.alfresco.service.cmr.repository.datatype.TypeConversionException: The property value is not compatible with the type defined for the property:
   property: Name: {http://www.mayoclinic.org/mss/Test/1.0}SignatureDate
Title: Signature Date
Description: null
Default Value: null
DataType Name: {http://www.alfresco.org/model/dictionary/1.0}date
ContainerClass Name: {http://www.mayoclinic.org/mss/Test/1.0}ConsentForm
isMultiValued: false
isMandatory: false
isMandatoryEnforced: false
isProtected: false
isIndexed: true
isStoredInIndex: false
isIndexedAtomically: true
indexTokenisationMode: TRUE

   value:
   value type: class java.lang.String
   at org.alfresco.repo.domain.node.NodePropertyHelper.makeNodePropertyValue(NodePropertyHelper.java:323)
   at org.alfresco.repo.domain.node.NodePropertyHelper.addValueToPersistedProperties(NodePropertyHelper.java:276)
   at org.alfresco.repo.domain.node.NodePropertyHelper.convertToPersistentProperties(NodePropertyHelper.java:97)
[…]


The entry for this field in the content item's corresponding metadata file is:


<entry key="mssT002:SignatureDate"></entry>


… and the field is defined in my metadata model as:


<property name="mssT002:SignatureDate">
   <title>Signature Date</title>
   <type>d:date</type>
</property>


If I plug in a value for this field in ISO 8601 format (with timezone offset) like this:


<entry key="mssT002:SignatureDate">2012-02-23T12:42:00.111-05:00</entry>


… as described here …

http://blogs.alfresco.com/wp/pmonks/2009/10/22/bulk-import-from-a-filesystem/

… near the end of Peter's blog post, then the import works swimmingly – though of course I had to supply a value for an item whose non-mandatory field did not have a value.  (And after the import, I can click the "none" button when editing value of this field in the properties of the imported item via Alfresco Explorer:  Alfresco accepts this field as non-mandatory.)

Oh ye of great experience, what suggestions do you have to share regarding importing items with empty, non-mandatory d:date metadata field values?

Thanks!

Don
2 REPLIES 2

rjohnson
Star Contributor
Star Contributor
I've only done one or 2 bulk imports, but don't you just omit the "entry" line for the date property if its blank and that way you will get the default or a null (or possibly undefined) date?

oofdachile
Champ in-the-making
Champ in-the-making
Hi, Bob –

  Thanks for taking the time to reply.  Your idea worked, and now I can do my import.  Hooray!

  It might seem inconsistent that one must remove empty date field entries from an imported item's companion metadata file, while empty text field entries can stay, but knowing what the system wants makes getting the job done possible.

  Thanks again for your help!

Don