cancel
Showing results for 
Search instead for 
Did you mean: 

need help on moving space via javascript

miloradranitovi
Champ in-the-making
Champ in-the-making
I am beginer in learnig alfresco, and have this problem:

I need to move space (via javascript), from space that has applyed content rule - link to category. 
Destination space doesn't have rules applyed. This is where i get the folowing error:

Failed to run Actions due to error: Found 1 integrity violations: The association parent multiplicity has been violated: Target Node: workspace://SpacesStore/3e9054d6-527d-4c01-bf05-161262a4def1 Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/rule/1.0}rules], name={http://www.alfresco.org/model/rule/1.0}ruleFolder, target class={http://www.alfresco.org/model/content/1.0}systemfolder, source role=null, target role=null] Required parent Multiplicity: 1..1 Actual parent Multiplicity: 0‍‍‍‍‍‍‍‍‍‍‍‍‍

Here is my javascript :
var source = companyhome.childByNamePath("Pisarnica/TEMP");var destination = companyhome.childByNamePath("Pisarnica/DEST");      items = source.children;      for each(item in items)      {         item.move(destination);      }‍‍‍‍‍‍‍‍‍‍‍‍‍
What is the right way to do this, and is there any other way?

Thanks, any help is welcome.
1 REPLY 1

miloradranitovi
Champ in-the-making
Champ in-the-making
OK, i have managed to do this by copying items from source folder, and then deleting them.