cancel
Showing results for 
Search instead for 
Did you mean: 

Filling cm:content properties during metadata extraction

masterhard
Champ on-the-rise
Champ on-the-rise
Hello,

I am writing custom metadata extractor. Some portions of my metadata are relatively big files (several megs) and I need this file to be stored separately from uploaded file.

When I use AbstractMappingMetadataExtractor.putRawValue method, when property type is cm:content I get empty reference in repository (looking like contentUrl=|mimetype=|size=0|encoding=|locale=en_US_|id=69). When property type is cm:mltext (my data is actually XML file) I get mysql exception (string too long) since data is really too long.

How to  set cm:content data in appropriate way?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
You can store content in another property in addition to cm:content.   Its not a widely used feature of Alfresco and may have rough edges but it does work.

The other approach is to store your extraction in another node and define an association between the two nodes.

masterhard
Champ on-the-rise
Champ on-the-rise
Thank you for your response. It looks like my content does not fit any data type since it is too big. As I can see, string property values are stored in MySQL in the column of type 'text'. That means 64K limit. But I have several megabytes. Anyway it's not good to store blobs or texts of several megabytes in MySQL tables.

Node association scenario suits my needs pretty well. I understand that I can inject into my metadata extractor NodeService, Repository or any other dependencies I need. But how to make an association with the node being created? I have one more scenario: search. The user should be able to find main node and then using some tools (probably webscripts, or even some remote API), get extracted content. For this search scenario I think parent-child association would be great.