cancel
Showing results for 
Search instead for 
Did you mean: 

Start js script from scheduled-jobs-context.xml

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

I want to start a js script automaticly. To do that I need to modify this file : scheduled-jobs-context.xml

I have a sample which start a js in "CompanyHome/Data Dictionnary/…" but my script is not in Data Dictionnary (I can't see it (also in other folders).

<value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/cm:Record_x0020_Management/cm:testscript.js"' )}
http://wiki.alfresco.com/wiki/Scheduled_Actions

My script was created in a amp module. It is working. These are ways to access it

WEB : http://ged:8080/alfresco/service/custom/searchRedundant
Disk: /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/module/custom/searchRedundant/searchRedundant.get.js

I have tried this :
scheduled-jobs-context.xml

<value>'/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/module/custom/searchRedundant/searchRedundant.get.js'</value>
Erreur:

15:05:00,086  ERROR [quartz.core.JobRunShell] Job jobGroup.jobD threw an unhandled Exception:
org.alfresco.error.AlfrescoRuntimeException: 06290001 Invalid store ref: Does not contain ://   '/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/module/custom/searchRedundant
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
15:05:00,088  ERROR [quartz.core.ErrorLogger] Job (jobGroup.jobD threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 06290001 Invalid store ref: Does not contain ://   '/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/module/custom/searchRedundant]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 06290001 Invalid store ref: Does not contain ://   '/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/module/custom/searchRedundant
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        … 1 more

How can I access my js file from Scheduled_Actions ?

(Alfresco 3.4d)
Thank you

(On fr : http://forums.alfresco.com/fr/viewtopic.php?f=25&t=5122#p23546)
8 REPLIES 8

dranakan
Champ on-the-rise
Champ on-the-rise
I put my script in the dictionary/scripts. But it's not working with scheduled (I can execute the script manualy). What is wrong ?

opt/Alfresco/tomcat/shared/classes/alfresco/extension/scheduled-action-services-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!–
    Define the model factory used to generate object models suitable for use with freemarker templates.
    –>
    <bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory">
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>

         <!–
        Execute the script
        –>
        <bean id="runScriptAction" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition">
            <property name="actionName">
                <value>script</value>
            </property>
            <property name="parameterTemplates">
                <map>
                    <entry>
                        <key>
                            <value>script-ref</value>
                        </key>
                        <value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:searchredundant.js"' )}</value>
                    </entry>
                </map>
            </property>
            <property name="templateActionModelFactory">
                <ref bean="templateActionModelFactory"/>
            </property>
            <property name="dictionaryService">
                <ref bean="DictionaryService"/>
            </property>
            <property name="actionService">
                <ref bean="ActionService"/>
            </property>
            <property name="templateService">
                <ref bean="TemplateService"/>
            </property>
        </bean>

        <!–
       Run the script every minute - select the single node company home that is not used …
        –>
        <bean id="runScript" class="org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition">
            <property name="transactionMode">
                <value>UNTIL_FIRST_FAILURE</value>
            </property>
            <property name="compensatingActionMode">
                <value>IGNORE</value>
            </property>
            <property name="searchService">
                <ref bean="SearchService"/>
            </property>
            <property name="templateService">
                <ref bean="TemplateService"/>
            </property>
            <property name="queryLanguage">
                <value>lucene</value>
            </property>
            <property name="stores">
                <list>
                    <value>workspace://SpacesStore</value>
                </list>
            </property>
            <property name="queryTemplate">
                <value>PATH:"/app:company_home"</value>
            </property>
            <property name="cronExpression">
                <value>0 0/1 * * * ?</value>
            </property>
            <property name="jobName">
                <value>jobD</value>
            </property>
            <property name="jobGroup">
                <value>jobGroup</value>
            </property>
            <property name="triggerName">
                <value>triggerD</value>
            </property>
            <property name="triggerGroup">
                <value>triggerGroup</value>
            </property>
            <property name="scheduler">
                <ref bean="schedulerFactory"/>
            </property>
            <property name="actionService">
                <ref bean="ActionService"/>
            </property>
            <property name="templateActionModelFactory">
                <ref bean="templateActionModelFactory"/>
            </property>
            <property name="templateActionDefinition">
                <ref bean="runScriptAction"/> <!– This is name of the action (bean) that gets run –>
            </property>
            <property name="transactionService">
                <ref bean="TransactionService"/>
            </property>
            <property name="runAsUser">
                <value>System</value>
            </property>
        </bean>
</beans>

Error

11:22:00,055  ERROR [quartz.core.JobRunShell] Job jobGroup.jobD threw an unhandled Exception:
org.alfresco.error.AlfrescoRuntimeException: 07040007 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
11:22:00,055  ERROR [quartz.core.ErrorLogger] Job (jobGroup.jobD threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 07040007 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 07040007 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        … 1 more

Path to the script (with Node Broswer)

/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/applicatio...

Thanks

dranakan
Champ on-the-rise
Champ on-the-rise
I have tried to start a script from Alfresco : alfresco docs.js. I get same error….

/opt/Alfresco/tomcat/shared/classes/alfresco/extension/scheduled-action-services-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!–
    Define the model factory used to generate object models suitable for use with freemarker templates.
    –>
    <bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory">
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>

         <!–
        Execute the script
        –>
        <bean id="runScriptAction" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition">
            <property name="actionName">
                <value>script</value>
            </property>
            <property name="parameterTemplates">
                <map>
                    <entry>
                        <key>
                            <value>script-ref</value>
                        </key>
                        <value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:alfresco docs.js"' )}</value>
                    </entry>
                </map>
            </property>
            <property name="templateActionModelFactory">
                <ref bean="templateActionModelFactory"/>
            </property>
            <property name="dictionaryService">
                <ref bean="DictionaryService"/>
            </property>
            <property name="actionService">
                <ref bean="ActionService"/>
            </property>
            <property name="templateService">
                <ref bean="TemplateService"/>
            </property>
        </bean>

        <!–
       Run the script every minute - select the single node company home that is not used …
        –>
        <bean id="runScript" class="org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition">
            <property name="transactionMode">
                <value>UNTIL_FIRST_FAILURE</value>
            </property>
            <property name="compensatingActionMode">
                <value>IGNORE</value>
            </property>
            <property name="searchService">
                <ref bean="SearchService"/>
            </property>
            <property name="templateService">
                <ref bean="TemplateService"/>
            </property>
            <property name="queryLanguage">
                <value>lucene</value>
            </property>
            <property name="stores">
                <list>
                    <value>workspace://SpacesStore</value>
                </list>
            </property>
            <property name="queryTemplate">
                <value>PATH:"/app:company_home"</value>
            </property>
            <property name="cronExpression">
                <value>0 0/1 * * * ?</value>
            </property>
            <property name="jobName">
                <value>jobD</value>
            </property>
            <property name="jobGroup">
                <value>jobGroup</value>
            </property>
            <property name="triggerName">
                <value>triggerD</value>
            </property>
            <property name="triggerGroup">
                <value>triggerGroup</value>
            </property>
            <property name="scheduler">
                <ref bean="schedulerFactory"/>
            </property>
            <property name="actionService">
                <ref bean="ActionService"/>
            </property>
            <property name="templateActionModelFactory">
                <ref bean="templateActionModelFactory"/>
            </property>
            <property name="templateActionDefinition">
                <ref bean="runScriptAction"/> <!– This is name of the action (bean) that gets run –>
            </property>
            <property name="transactionService">
                <ref bean="TransactionService"/>
            </property>
            <property name="runAsUser">
                <value>System</value>
            </property>
        </bean>
</beans>

Error
2011-08-12 12:54:00,031 ERROR [org.quartz.core.JobRunShell] Job jobGroup.jobD threw an unhandled Exception:
org.alfresco.error.AlfrescoRuntimeException: 07120002 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
2011-08-12 12:54:00,031 ERROR [org.quartz.core.ErrorLogger] Job (jobGroup.jobD threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 07120002 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 07120002 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts
        at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)
        at org.alfresco.service.cmr.repository.NodeRef.<init>(NodeRef.java:91)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:248)
        at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$17.convert(DefaultTypeConverter.java:245)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
        at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:68)
        at org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition.getAction(SimpleTemplateActionDefinition.java:200)
        at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getAction(CronScheduledQueryBasedTemplateActionDefinition.java:262)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1$2.execute(AbstractScheduledAction.java:564)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:253)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.runTransactionalAction(AbstractScheduledAction.java:558)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:426)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
        at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        … 1 more

What is wrong in my file ?

Thank you

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

Bug in 3.4D… we can avoid it (not tested… I wait the 4.0a) : https://issues.alfresco.com/jira/browse/ALF-9981

massanen
Champ in-the-making
Champ in-the-making
Hi dranakan,

i have the same issue, and once I checked the jire I've tried to solve that problem changing the value of:

<value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cmSmiley Tonguereaviso_multimail_planeta.js"')}</value>

to

<value>\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cmSmiley Tonguereaviso_multimail_planeta.js"')\}</value>

(With the \ character before $, { and }.

But in jira they also speak about "r30551". They exactly say: "ou'll need to also have the change from r30551 applied to your repo, so it knows to correctly de-escape FTL when it arrives."

What is "r30551"?? what I have to do to make my job scheduling work??


thanks a lot

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

But in jira they also speak about "r30551". They exactly say: "ou'll need to also have the change from r30551 applied to your repo, so it knows to correctly de-escape FTL when it arrives."

What is "r30551"?? what I have to do to make my job scheduling work??

I don't know… Have you tried with 4.0b ?

massanen
Champ in-the-making
Champ in-the-making
yes, the version 4.0b works perfectly.

The problem is that my client has 3.4d… and I'm asking myself is there is another way to tell the file custom-scheduled-jobs-context.xml to execute a javascript, or even if it's possible to execute a java code…

what do you think…?

thanks a lot

janguela
Champ in-the-making
Champ in-the-making

<value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:alfresco docs.js"' )}</value>
What is wrong in my file ?
Thank you

Hi,
I think that I found why your script is not working. I was implementing the same use case and I came up with this post. I did test the same solution and it worked for me. So the only difference with your code is the script file name being executed.

It will sound stupid but try this: instead of using "cm:alfresco docs.js"  use  "cm:alfresco_x0020_docs.js". I'm pretty sure it will work then  Smiley Very Happy

I found the solution using Alfresco Node Browser -> Lucene search :

PATH:"/app:company_home/app:dictionary/app:scripts/cm:alfresco docs.js"  –> 0 results
PATH:"/app:company_home/app:dictionary/app:scripts/cm:alfresco_x0020_docs.js" —> 1 result

Good luck!
Jordi

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you janguela.