<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Action Javascript ScriptLocation in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/action-javascript-scriptlocation/m-p/59901#M36907</link>
    <description>&lt;P&gt;Salut!&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Avez-vous une erreur dans le log?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cristina.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Aug 2021 13:30:23 GMT</pubDate>
    <dc:creator>cristinamr</dc:creator>
    <dc:date>2021-08-10T13:30:23Z</dc:date>
    <item>
      <title>Action Javascript ScriptLocation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/action-javascript-scriptlocation/m-p/59900#M36906</link>
      <description>&lt;P&gt;Bonjour,&lt;/P&gt;&lt;P&gt;je tente de mettre en place une action dans Share :&lt;/P&gt;&lt;P&gt;J'ai donc déclaré dans share-config-custom :&lt;/P&gt;&lt;PRE&gt;&amp;lt;config evaluator="string-compare" condition="DocLibActions"&amp;gt;
      &amp;lt;actions&amp;gt;
         &amp;lt;action id="run-wkfactes" icon="document-assign-workflow" type="javascript" label="Lancer le process"&amp;gt;
            &amp;lt;param name="function"&amp;gt;onActionSimpleRepoAction&amp;lt;/param&amp;gt;
            &amp;lt;param name="action"&amp;gt;run-wkfactes-action&amp;lt;/param&amp;gt;
            &amp;lt;param name="successMessage"&amp;gt;Lancement process Ok&amp;lt;/param&amp;gt;
            &amp;lt;param name="failureMessage"&amp;gt;Lancement process Erreur&amp;lt;/param&amp;gt;
	         &amp;lt;evaluator&amp;gt;selestat.evaluator.custom.isWebdelibExport&amp;lt;/evaluator&amp;gt;
         &amp;lt;/action&amp;gt;
      &amp;lt;/actions&amp;gt;
      &amp;lt;actionGroups&amp;gt;
            &amp;lt;actionGroup id="folder-browse"&amp;gt;
                  &amp;lt;action index="260" id="run-wkfactes" /&amp;gt;
            &amp;lt;/actionGroup&amp;gt;
      &amp;lt;/actionGroups&amp;gt;
   &amp;lt;/config&amp;gt;&lt;/PRE&gt;&lt;P&gt;Puis :&lt;/P&gt;&lt;PRE&gt;&amp;lt;bean id="selestat.evaluator.custom.isWebdelibExport" parent="evaluator.doclib.metadata.hasAspect"&amp;gt;
                &amp;lt;property name="aspects"&amp;gt;
                        &amp;lt;list&amp;gt;
                                &amp;lt;value&amp;gt;export:webdelib&amp;lt;/value&amp;gt;
                        &amp;lt;/list&amp;gt;
                &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/PRE&gt;&lt;P&gt;Et enfin :&lt;/P&gt;&lt;PRE&gt;&amp;lt;bean id="run-wkfactes-action" parent="script"&amp;gt;
		&amp;lt;property name="scriptLocation"&amp;gt;
			&amp;lt;bean class="org.alfresco.repo.jscript.ClasspathScriptLocation"&amp;gt;
				&amp;lt;constructor-arg&amp;gt;
					&amp;lt;value&amp;gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;STRONG&gt;/Espace racine/Dictionnaire de données/Scripts/wkf_actes.js&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&amp;lt;/value&amp;gt;
				&amp;lt;/constructor-arg&amp;gt;
			&amp;lt;/bean&amp;gt;
		&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/PRE&gt;&lt;P&gt;L'action "Lancer le process" apparait bien dans Share mais mon problème c'est que je ne veut pas que le .js soit stocké sur le FS alfresco mais dans le Doclib.&lt;/P&gt;&lt;P&gt;En effet, ce js est stocké dans /Entrepot/Dictionnaire de données/Scripts/. C'est d'ailleurs un script qui est executé via cron (scheduled-jobs). Il d'ailleurs déclaré ainsi dans scheduled-jobs-context :&lt;/P&gt;&lt;PRE&gt;&amp;lt;bean id="runScriptAction2" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition"&amp;gt;
            &amp;lt;property name="actionName"&amp;gt;
                &amp;lt;value&amp;gt;script&amp;lt;/value&amp;gt;
            &amp;lt;/property&amp;gt;
            &amp;lt;property name="parameterTemplates"&amp;gt;
                &amp;lt;map&amp;gt;
                    &amp;lt;entry&amp;gt;
                        &amp;lt;key&amp;gt;
                            &amp;lt;value&amp;gt;script-ref&amp;lt;/value&amp;gt;
                        &amp;lt;/key&amp;gt;
                        &amp;lt;value&amp;gt;\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:wkf_actes.js"' )\}&amp;lt;/value&amp;gt;
                    &amp;lt;/entry&amp;gt;
                &amp;lt;/map&amp;gt;
            &amp;lt;/property&amp;gt;
            &amp;lt;property name="templateActionModelFactory"&amp;gt;
                &amp;lt;ref bean="templateActionModelFactory"/&amp;gt;
            &amp;lt;/property&amp;gt;
            &amp;lt;property name="dictionaryService"&amp;gt;
                &amp;lt;ref bean="DictionaryService"/&amp;gt;
            &amp;lt;/property&amp;gt;
            &amp;lt;property name="actionService"&amp;gt;
                &amp;lt;ref bean="ActionService"/&amp;gt;
            &amp;lt;/property&amp;gt;
            &amp;lt;property name="templateService"&amp;gt;
                &amp;lt;ref bean="TemplateService"/&amp;gt;
            &amp;lt;/property&amp;gt;
        &amp;lt;/bean&amp;gt;&lt;/PRE&gt;&lt;P&gt;Pour revenir au bean qui permet de déclarer le script JS de l'action, je ne connais que :&lt;/P&gt;&lt;PRE&gt;org.alfresco.repo.jscript.ClasspathScriptLocation&lt;/PRE&gt;&lt;P&gt;Cela ne permet que d'indiquer un script stocké dans un répertoire du FS.&lt;/P&gt;&lt;P&gt;Je ne sais pas si il est possible d'appeler un script stocké dans le doclib ? A l'instar de ce qu'il est possible de déclarer pour le Scheduled job.&lt;/P&gt;&lt;P&gt;Je voudrais à tout prix éviter de stocké ce script à deux endroits. Pour des questions maintenance et de dev, ce serait très pénible.&lt;/P&gt;&lt;P&gt;Merci&lt;/P&gt;&lt;P&gt;Cordialement&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:01:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/action-javascript-scriptlocation/m-p/59900#M36906</guid>
      <dc:creator>sebbri</dc:creator>
      <dc:date>2021-08-04T15:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Action Javascript ScriptLocation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/action-javascript-scriptlocation/m-p/59901#M36907</link>
      <description>&lt;P&gt;Salut!&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Avez-vous une erreur dans le log?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cristina.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 13:30:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/action-javascript-scriptlocation/m-p/59901#M36907</guid>
      <dc:creator>cristinamr</dc:creator>
      <dc:date>2021-08-10T13:30:23Z</dc:date>
    </item>
  </channel>
</rss>

