cancel
Showing results for 
Search instead for 
Did you mean: 

Specify destination space in forms

soulpower
Champ in-the-making
Champ in-the-making
Hi guys,

maybe I'm running into a trivial problem but I can't find nothing useful over the forum and the web.

When creating a (custom type) content from Share, the user must pick the destination space where the new content element should be placed when saved.

I know there is a "destination" parameter for calling the /share/page/components/form restlet service which renders the desidered form, but the destination space is not known prior to the form rendering, because it must be selected by the user itself!

I'm not using the document library interface, because I'm building a custom interface.

Please help!!

Roberto
3 REPLIES 3

mikeh
Star Contributor
Star Contributor

soulpower
Champ in-the-making
Champ in-the-making
Thank you Mike, I'll give a look and post back my solution.
Cheers,
Roberto

soulpower
Champ in-the-making
Champ in-the-making
Ok I've solved in this way. Maybe it's not so elegant, but it's easy and it works  :wink:
I've used a rule, a script and the cm:attachable aspect borrowed and adapted from datalist model.
In the form definition I've put the UI for picking the destination space (using associations.ftl template).
The new folder is stored in a default temporary space and the rule is fired. The rule execute a script which moves the new folder to the target space with document.move(target); the target is taken from the association property of the aspect (which is filled by the previous destination space picker). Finally, the script nullify the association property.
Hope this can help other folks.
Cheers,
Roberto