cancel
Showing results for 
Search instead for 
Did you mean: 

Move scanned doc to space based on metadatavalue?

peterh_nl
Champ in-the-making
Champ in-the-making
Probably a stupid and simple question from a newbie but i'd really appreciate a hint or direction to accomplish the following:

I like to process scanned mail from external source. I dump it into a space and then want to:
1. move it to the userspace\INBOX of the user who's name is in the value of the owner metadata-field of the imported document (pdf with value filled by indexvalue)
2. send a notifier to the user when the document arrives in his/hers INBOX
3. offer the user a simple workflow to handle his mail with some simple workflow options moving the files around untill it reaches the status 'archived' (space under userhome)

I have al steps working as i'd like to test in my organisatie but get stuck on step 1: how to 'automagically' extract the value of the 'owner'-property (=username), find the homedirectory and finally add a move-to-space-action to get it in the space I need it to 'land'? To make things a little more difficult I'd like to use some groups (e.g. 'finance') and move the document to a corresponding (department-)home-space following an equal structure in the simple-workflow.

Can this be done? I 'suspect' it could be done with some javascript but before i dive deep into that i'd like to check whether this is the right direction and .. maybe it's very simple for one or more of you outthere.. :shock:  Thank you very much for your help!
(as mentioned in opening: sorry for this nubiekind of question..(trying to learn fast though.. :lol:
5 REPLIES 5

peterh_nl
Champ in-the-making
Champ in-the-making
hmm. obviously a very stupid question, expected it to be a simple issue for experienced audience.. :roll:

kevinr
Star Contributor
Star Contributor
Yes JavaScript would be the right approach to perform step 1 - you can do all you want except the Group access - we don't have a Group API for JavaScript yet, that will appear in 2.1.

Thanks,

Kevin

kevinr
Star Contributor
Star Contributor
CORRECTION - the 'people' object in the JavaScript API provides access to Groups and Group members in Alfresco 2.0:
http://wiki.alfresco.com/wiki/JavaScript_API#People_API

Thanks,

Kevin

peterh_nl
Champ in-the-making
Champ in-the-making
Thanx for your reply Kevin!
Could you point me to a bit of example code on this?  Smiley Tongue
Peter

darko_narandzic
Champ in-the-making
Champ in-the-making
Here is some eample code. I hope it hlelps.


var mail = actions.create("mail");
var modifier = people.getPerson(document.properties.modifier);
mail.parameters.to = modifier.properties.email;
mail.parameters.subject = "Subject text";
mail.parameters.from = "alfresco@alfrescodomain.com";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/YourEmailTemplate.ftl");
mail.parameters.text = "Email body text";
mail.execute(document);
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.