<?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 Help with creating web-scripts in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/help-with-creating-web-scripts/m-p/31710#M13450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm new to Alfresco and according to some needs, I need to work on some web-scripts to automate a few things. I got into it followig some examples from &lt;A _jive_internal="true" href="https://community.alfresco.com/docs/DOC-5367-javascript-api-cookbook#jive_content_id_Add_Aspects" rel="nofollow noopener noreferrer"&gt;JavaScript API Cookbook | Alfresco Community&lt;/A&gt; but I can't seem to get them to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a simple script with Javascript to create a folder, making use of this function: &lt;A class="link-titled" href="http://docs.alfresco.com/5.1/references/API-JS-createFolder.html" title="http://docs.alfresco.com/5.1/references/API-JS-createFolder.html" rel="nofollow noopener noreferrer"&gt;createFolder | Alfresco Documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copied the .js (with that function call) and .desc files into /Data Directory/Web Scripts/org/alfresco/sample, but when I go to &lt;STRONG&gt;alfresco:8080/alfresco/services/createFolder &lt;/STRONG&gt;I see a message saying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ReferenceError: "userhome" is not defined.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Looks like I can't access any Root Object and I honestly don't know what's going wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said the Javascript file only contains a call to the createFolder() function (actually copied the line of code from the docs) and the desc.xml file contains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;webscript&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;shortname&amp;gt;Ejemplo para crear directorio&amp;lt;/shortname&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;description&amp;gt;se crea directorio&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;url&amp;gt;/createFolder&amp;lt;/url&amp;gt;&lt;BR /&gt;&amp;lt;/webscript&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Am I missing something? Any help would be much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Aug 2017 12:54:03 GMT</pubDate>
    <dc:creator>mperez</dc:creator>
    <dc:date>2017-08-03T12:54:03Z</dc:date>
    <item>
      <title>Help with creating web-scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/help-with-creating-web-scripts/m-p/31710#M13450</link>
      <description>Hi, I'm new to Alfresco and according to some needs, I need to work on some web-scripts to automate a few things. I got into it followig some examples from JavaScript API Cookbook | Alfresco Community but I can't seem to get them to work.I made a simple script with Javascript to create a folder, mak</description>
      <pubDate>Thu, 03 Aug 2017 12:54:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/help-with-creating-web-scripts/m-p/31710#M13450</guid>
      <dc:creator>mperez</dc:creator>
      <dc:date>2017-08-03T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with creating web-scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/help-with-creating-web-scripts/m-p/31711#M13451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this link could be useful:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://stackoverflow.com/questions/6463958/how-can-i-be-able-to-create-a-folder-node-on-companyhome-in-alfresco" title="https://stackoverflow.com/questions/6463958/how-can-i-be-able-to-create-a-folder-node-on-companyhome-in-alfresco" rel="nofollow noopener noreferrer"&gt;java - How can I be able to create a folder node on companyhome in Alfresco? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After upload the files to "Repository" you have to check if the new webscript is available.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visit the url:&amp;nbsp;&lt;A class="link-titled" href="http://localhost:8383/alfresco/service/index" title="http://localhost:8383/alfresco/service/index" rel="nofollow noopener noreferrer"&gt;http://localhost:8383/alfresco/service/index&lt;/A&gt;&amp;nbsp; (it depends of your alfresco server) and click on "Refresh Web Scripts"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test the example:&amp;nbsp;&lt;A class="link-titled" href="http://localhost:8383/alfresco/service/createfolder?folder=test123" title="http://localhost:8383/alfresco/service/createfolder?folder=test123" rel="nofollow noopener noreferrer"&gt;http://localhost:8383/alfresco/service/createfolder?folderName=test123&lt;/A&gt;&amp;nbsp;(something like that changing server and port) and you'll obtain a response similar to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Successfully created a folder with the following metadata:&lt;/SPAN&gt;&lt;BR style="color: #000000;" /&gt;&lt;SPAN style="color: #000000;"&gt;Name: test123&lt;/SPAN&gt;&lt;BR style="color: #000000;" /&gt;&lt;SPAN style="color: #000000;"&gt;ID: d241a1ff-ab61-4002-a1fb-367e4f626309&lt;/SPAN&gt;&lt;BR style="color: #000000;" /&gt;&lt;SPAN style="color: #000000;"&gt;Noderef: workspace://SpacesStore/d241a1ff-ab61-4002-a1fb-367e4f626309&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This folder are created under "Repository" but you can try to find exactly what you need, I mean create a folder under userHome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 12:30:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/help-with-creating-web-scripts/m-p/31711#M13451</guid>
      <dc:creator>calvo</dc:creator>
      <dc:date>2017-08-04T12:30:28Z</dc:date>
    </item>
  </channel>
</rss>

