<?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: Problem With Javascript to Dynamically Create Spaces/Folders in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-javascript-to-dynamically-create-spaces-folders/m-p/250478#M203608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var newSpaceName = rootSpaceName.createFolder(childTitle);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Because the code as written will try to create a folder with the same name as the document that is already in the mainFolder. For example, if I have a document called "test.txt" your code tries to create a folder called "test.txt" and that's not going to fly–nodes must be uniquely named in a given folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To answer your logging question you can use logger.log but you have to turn on debugging in log4j.properties by setting:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Another tool you might be interested in is Florian Maul's &lt;/SPAN&gt;&lt;A href="http://addons.alfresco.com/addons/javascript-console" rel="nofollow noopener noreferrer"&gt;JavaScript Console&lt;/A&gt;&lt;SPAN&gt;. It lets you run JavaScript interactively in the Share UI. Use "print" to write statements to that console.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2012 23:21:26 GMT</pubDate>
    <dc:creator>jpotts</dc:creator>
    <dc:date>2012-08-22T23:21:26Z</dc:date>
    <item>
      <title>Problem With Javascript to Dynamically Create Spaces/Folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-javascript-to-dynamically-create-spaces-folders/m-p/250477#M203607</link>
      <description>Hi everyone, I am currently working with Alfresco 4.0.d community edition on a Oracle Linux 6 virtual machine, using Firefox as my browser.Most recently, I had been attempting to create a script which could be executed via a rule that would dynamically create sub-folders as new items entered a space</description>
      <pubDate>Wed, 22 Aug 2012 16:16:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-javascript-to-dynamically-create-spaces-folders/m-p/250477#M203607</guid>
      <dc:creator>th1s_pr0gramm3r</dc:creator>
      <dc:date>2012-08-22T16:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Javascript to Dynamically Create Spaces/Folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-javascript-to-dynamically-create-spaces-folders/m-p/250478#M203608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var newSpaceName = rootSpaceName.createFolder(childTitle);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Because the code as written will try to create a folder with the same name as the document that is already in the mainFolder. For example, if I have a document called "test.txt" your code tries to create a folder called "test.txt" and that's not going to fly–nodes must be uniquely named in a given folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To answer your logging question you can use logger.log but you have to turn on debugging in log4j.properties by setting:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Another tool you might be interested in is Florian Maul's &lt;/SPAN&gt;&lt;A href="http://addons.alfresco.com/addons/javascript-console" rel="nofollow noopener noreferrer"&gt;JavaScript Console&lt;/A&gt;&lt;SPAN&gt;. It lets you run JavaScript interactively in the Share UI. Use "print" to write statements to that console.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 23:21:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-javascript-to-dynamically-create-spaces-folders/m-p/250478#M203608</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-08-22T23:21:26Z</dc:date>
    </item>
  </channel>
</rss>

