Alfresco Dictionary使用javascript添加了大量数据



我有一个我知道的字典nodeRef。我需要用很多值来填充这个字典,这些值必须手动或使用javascript控制台导入。有没有办法使用javascript控制台导入这些值?例如:

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

提前谢谢。

如果您使用JS控制台作为附加组件,那么您可以使用以下脚本导入noderef和acp。

参考编号: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);

最新更新