05-18-2011 09:00 AM
var contentType = "sc:demConge";
var timestamp = new Date().getTime();
var demander_Node = space.createNode("lol" + timestamp,contentType);
demander_Node.properties["sc:raison"] = "Maladie";
demander_Node.save();
demander_Node.setName(demander_Node.properties["cm:creator"] + timestamp );
le scripte fonctionne et effectue le travail demandé quand je le lance à travers Run action et si je choisi exécuter un javascript.
<config>
<actions>
<action id="Creer_Demande_Conge">
<label>Creer Demande Conge</label>
<label-id>edit</label-id>
<tooltip>My Tooltip</tooltip>
<tooltip-id>tooltip</tooltip-id>
<onclick>javascript:myhandler</onclick>
<!– script attribute for specifying a javascript file to execute - by Path or NodeRef –>
<script>/Company Home/Data Dictionary/Scripts/content.js</script>
<!– params specify the <f:param> tags to be generated as children of the action component –>
<!– accessable by an ActionEvent handler or passed directly as href/script URL arguments –>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<action-group id="space_details_actions">
<action idref="Creer_Demande_Conge" />
</action-group>
</actions>
</config>
le bouton s'affiche correctement mais lorsque je clique dessous un message d'erreur s'affiche et voila son contenu org.alfresco.error.AlfrescoRuntimeException: 04180010 Error during command servlet processing: 04180009 Failed to execute script 'workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa': 04180008 ReferenceError: "space" n'est pas défini (workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa#3)
caused by:
org.alfresco.scripts.ScriptException: 04180009 Failed to execute script 'workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa': 04180008 ReferenceError: "space" n'est pas défini (workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa#3)
caused by:
org.alfresco.error.AlfrescoRuntimeException: 04180008 ReferenceError: "space" n'est pas défini (workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa#3)
caused by:
org.mozilla.javascript.EcmaError: ReferenceError: "space" n'est pas défini (workspace://SpacesStore/69aa38d1-34d6-4afa-a480-ee5b112ac2aa#3)
05-18-2011 09:24 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.