cancel
Showing results for 
Search instead for 
Did you mean: 

Email metadata in Attachment

reggiepr
Champ in-the-making
Champ in-the-making
Hi,

I recently installed 3.2 and it's working like a charm!  BUT i just cant find the way to transfer email metadata like the subject to the attachment properties.  I created a rule to add the Email Aspect to the incoming document from a Scanner Email and later extract the metadata but nothing is passed to the attachment properties (Email aspect empty).

Does this functionality require additional programing? I will appreciate any lead!

Thank you!

Reggie.
6 REPLIES 6

mrogers
Star Contributor
Star Contributor
How are you adding your document from your email scanner?  Are you uploading it through one of the UIs or via SMTP, IMAP, CIFS, WebDav or FTP?

If you are specifying a "mime type" then what are you specifying ?

And what exactly do you mean by the "Email Aspect".    What's the qname?

reggiepr
Champ in-the-making
Champ in-the-making
How are you adding your document from your email scanner?  Are you uploading it through one of the UIs or via SMTP, IMAP, CIFS, WebDav or FTP?

If you are specifying a "mime type" then what are you specifying ?

And what exactly do you mean by the "Email Aspect".    What's the qname?

Sorry for not being more specific.   The documents are sent via SMTP to an email alias associated with a space.  I specified an Email mime type in the condition of the rule than later thought wise to add the "Emailed" aspect in the action setting so that the the properties from the "Extract common metadata fields from content"  could be assigned to the PDF document attached with the email.

Obviously that was a wishful thinking on how things could work but apparently this is not done so easily.

The problem is that I endup with a pdf document on disk with no metadata whatsoever except for the useless automatically assigned filename by the multifunctional scanner.

Got the picture?

reggiepr
Champ in-the-making
Champ in-the-making
I keep searching the forum posts for a similar issue and some are suggesting using Kofax and e-copy which are commercial solutions.  However I could live with a rule or a script that copies the subject of the originating email from the scanner to the Title of the PDF attachment?  I also observed that the plain text file extracted from the email has the a reference in its metadata to the attachment(not a link though):

Eg. "Attachments: /company_home/Prueba/tabletpc specs and quote.pdf"

mrogers
Star Contributor
Star Contributor
I think you will have to write a few lines of code to rename your PDF file when it is added to alfresco.

You can do this by adding a rule or a behaviour.  

One concern I have about that approach is that there may be a race condition between the metadata extractor for PDF files and your code.   For example after your code the metadata extractor for PDF comes along and re-sets the value.  It will need a little experimentation to get working.

reggiepr
Champ in-the-making
Champ in-the-making
Ok, I've conceived a way to get I want and it consists of reading the attachment information from the document using javascript and later renaming that file with the email subject title.  However after reading the javascript API I didnt find specific examples or details on how to do so. 
As you can see in the picture, the attachment full path appears in the properties under "Attachments".  Now, how do I read that info from javascript? I tried 'document.properties', 'document.assocs' with no luck.  I guess that for you the experts or the more experienced, it must be a piece of cake.. so HELP!!!!
[img]http://www.mojicas.com/dish/alfresco_attachment.jpg[/img]

Thanks!!

reggiepr
Champ in-the-making
Champ in-the-making
Well i had to burn my brain in it and with some trial and error and using the API logic i could make it work.

I used:

for each (n in document.assocs["cm:attachments"])


Now going for some serious study into this thing… LOVE IT!