-1

I have a dictionary nodeRef that i know. I need to fill this dictionary with a lot of values, this values have to be imported by hand or using javascript console. Is there a way using javascript console to import this values? For example:

var firstArray = ['a','b','c'];
var secondArray =['1','2','3'];
var dict = search.findNode("workspace://SpacesStore/9f3291b8-9733-45bd-8537-7c2e8a18cd2a");
...
...

Thank's in advance.

john2994
  • 393
  • 1
  • 3
  • 15
  • 1
    Could you please more describe your exact problem? Where is the corelation from your arrays to an alfresco node? Do you have a document model to set the properties to from a specific source? I can't see how to help you with that description. – Heiko Robert Dec 18 '20 at 11:26
  • I agree with Heiko, I don't understand the problem.. – Lista Dec 18 '20 at 20:06

1 Answers1

2

If you are using JS console as a add on, then you can use the below scripts to import noderef and acp.

Ref: https://gist.github.com/CesarCapillas/6f7692a1d657ce43851598ca9d5ecaa1

Import a script from the repository using a name-based path: 

<import resource="/Company Home/Data Dictionary/Scripts/library.js">

Import a script from the repository using a NodeRef reference: 

<import resource="workspace://SpacesStore/6f73de1b-d3b4-11db-80cb-112e6c2ea048">

Import a script from a Java classpath location: 

<import resource="classpath:alfresco/extension/myutils.js"> 

// Import ACP  
var targetNodeForImport = companyhome.childByNamePath("Sites/swsdp2/documentLibrary");  
var ACPFile = companyhome.childByNamePath("ACPexport.acp");  
var importAction = actions.create("import");  
importAction.parameters.encoding = "UTF-8";  
importAction.parameters.destination = targetNodeForImport;  
importAction.execute(ACPFile);
Arjun
  • 624
  • 2
  • 6