<?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 Script to search and extract meta data in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282628#M235758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are trying to create a script to get all the objects in a specific space (called "Aprobados") where the created or last modified date is today. And I also want to get all metadata from the searchrd objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help me please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me explain you the process I need to execute&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Search for all the pdf documents of a given space called "Aprobados" which have been modified "today".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) I need to create a txt file with all the metadata of all of those modified pdf documents stored in this space that matched this search criteria.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Place the txt file in a given space so another process can get it by FTP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code I have written, however I am not very sure of the search funcion, as I need to search in the "Aprobados" space but also inside its child nodes recursively.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please take a look to my code and let me know if you think it is ok?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will really appreciate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;// We create the folder to place the txt file&lt;BR /&gt;var subir = space.childByNamePath("Subir Facturas");&lt;BR /&gt;var recoger = subir.childByNamePath("Recoger");&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;// If there is already a txt file we must delete it&lt;BR /&gt;for each (var doc in recoger.children) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (doc.mimetype == "text/plain");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc.remove();&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;// Get the path to the parent space where to look for the files&lt;BR /&gt;var revision = space.childByNamePath("Revisar");&lt;BR /&gt;var aprobados = revision.childByNamePath("Aprobadas");&lt;BR /&gt;var today = new Date();&lt;BR /&gt;var ano = today.getFullYear();&lt;BR /&gt;var buscarAno = aprobados.childByNamePath(ano);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;// Now we firstly create the txt file&lt;BR /&gt;//String fecha = today.getDate() + "-" + today.getMonth() +1 + "-" + today.getFullYear();&lt;BR /&gt;file = recoger.createFile("metadatos_facturas.txt");&lt;BR /&gt; &lt;BR /&gt;// We run the search for all the pdf files that have been modified today in the&lt;BR /&gt;// space of the current year&lt;BR /&gt;var docs = search.xpathSearch([cm:modified]=today,buscarAno);&lt;BR /&gt; &lt;BR /&gt;// For each doc found matching the search clause we must write their metadata in the&lt;BR /&gt;// txt file - one row with metadata per file found&lt;BR /&gt; &lt;BR /&gt;for each (docs) {&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (docs!=null &amp;amp;&amp;amp; docs.mimetype == "application/pdf")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workingcopy=file.checkout();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workingcopy.content = "|"+docs.name+"|"+docs.start_date+"|"+docs.Private_Id+"|=";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file = workingcopy.checkin();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Apr 2014 06:53:29 GMT</pubDate>
    <dc:creator>jlabuelo</dc:creator>
    <dc:date>2014-04-03T06:53:29Z</dc:date>
    <item>
      <title>Script to search and extract meta data</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282628#M235758</link>
      <description>Hi allWe are trying to create a script to get all the objects in a specific space (called "Aprobados") where the created or last modified date is today. And I also want to get all metadata from the searchrd objects.Can anyone help me please?Let me explain you the process I need to execute1) Search f</description>
      <pubDate>Thu, 03 Apr 2014 06:53:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282628#M235758</guid>
      <dc:creator>jlabuelo</dc:creator>
      <dc:date>2014-04-03T06:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script to search and extract meta data</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282629#M235759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You may use PATH query to search from a specific folder based on a modified date and mimetype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/Search#Path_Queries" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search#Path_Queries&lt;/A&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2014 01:36:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282629#M235759</guid>
      <dc:creator>romschn</dc:creator>
      <dc:date>2014-04-15T01:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script to search and extract meta data</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282630#M235760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use following code to search content by path+modified+mimetype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;search.luceneSearch('+@cm\:modified:[2013-09-20T00:00:00.000 TO 2013-11-20T23:59:59.999] AND&amp;nbsp; +PATH:"//app:company_home//cm:Aprobados//*" AND +@cm\:content.mimetype:text/plain');&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Or you can use modified date+PATH+name phrase search&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2014 03:18:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-search-and-extract-meta-data/m-p/282630#M235760</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2014-04-15T03:18:00Z</dc:date>
    </item>
  </channel>
</rss>

