12-14-2013 06:17 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Registration of new models –>
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/customModel.xml</value>
</list>
</property>
</bean>
<bean id="onContentReadpolicy" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration">
<property name="policyName">
<value>{http://www.alfresco.org}onContentRead</value>
</property>
<property name="className">
<value>{http://www.alfresco.org/model/content/1.0}content</value>
</property>
<property name="behaviour">
<bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
<property name="location">
<bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
<constructor-arg>
<value>alfresco/extension/scripts/myscript.js</value>
</constructor-arg>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
12-14-2013 09:59 AM
12-14-2013 01:35 PM
logger.log("Script works!");
<?xml version="1.0" encoding="UTF-8"?>
<!– Custom Model –>
<!– Note: This model is pre-configured to load at startup of the Repository. So, all custom –>
<!– types and aspects added here will automatically be registered –>
<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Custom Model</description>
<author></author>
<version>1.0</version>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<!– Introduction of new namespaces defined by this model –>
<!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
<namespaces>
<namespace uri="custom.model" prefix="custom"/>
</namespaces>
</model>
12-16-2013 12:53 AM
12-16-2013 05:19 AM
….
<property name="location">
<bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
<constructor-arg>
<value>\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:myscript.js"' )\}</value>
</constructor-arg>
</bean>
</property>
….
11:10:04,136 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: \$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:myscript.js"' )\}(null)
12-16-2013 08:10 PM
12-17-2013 04:19 AM
var companyhome = search.findNode("path", ['workspace','SpacesStore','/']);
var newfolderz = companyhome.childByNamePath("Siti/Test-repository/documentLibrary");
var nodeToCopy = getNodeToCopy();
var yourNewNode = nodeToCopy.copy(newfolder);
function getNodeToCopy(){
return utils.getNodeFromString("workspace://SpacesStore/c1fcf42b-b61e-41c7-bafc-88aaccfa5d1c")
}
12-17-2013 09:56 PM
12-18-2013 06:51 AM
12-18-2013 10:09 AM
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.