<?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: Problems copying a document to several userHome in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82171#M25238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It all works until I do the copy(). If I have only one user, no problem!&lt;/P&gt;&lt;P&gt;That is why it is commented out!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Apr 2019 05:49:18 GMT</pubDate>
    <dc:creator>nimbus1958</dc:creator>
    <dc:date>2019-04-25T05:49:18Z</dc:date>
    <item>
      <title>Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82167#M25234</link>
      <description>I have a document with a custom type.One of those properties allow for the userNames of several users separated by space.A script reads these userNames and copy the document to the relevant userHome space.It works fine if I have only one user.When I have two or more, I get errors.Using the javascrip</description>
      <pubDate>Tue, 23 Apr 2019 08:19:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82167#M25234</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-23T08:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82168#M25235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffe0e0;"&gt;500 Internal Error Stacktrace-Details: org.springframework.extensions.webscripts.WebScriptException: 03252579 Wrapped Exception (with status template): null at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1138) at de.fme.jsconsole.ExecuteWebscript.executeScriptContent(ExecuteWebscript.java:405) at de.fme.jsconsole.ExecuteWebscript.access$100(ExecuteWebscript.java:56) at de.fme.jsconsole.ExecuteWebscript$2.execute(ExecuteWebscript.java:280) at de.fme.jsconsole.ExecuteWebscript$2.execute(ExecuteWebscript.java:273) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:352) at de.fme.jsconsole.ExecuteWebscript.runWithTransactionIfNeeded(ExecuteWebscript.java:272) at de.fme.jsconsole.ExecuteWebscript.access$000(ExecuteWebscript.java:56) at de.fme.jsconsole.ExecuteWebscript$1.doWork(ExecuteWebscript.java:250) at de.fme.jsconsole.ExecuteWebscript$1.doWork(ExecuteWebscript.java:247) at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555) at de.fme.jsconsole.ExecuteWebscript.runScriptWithTransactionAndAuthentication(ExecuteWebscript.java:247) at de.fme.jsconsole.ExecuteWebscript.execute(ExecuteWebscript.java:121) at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:467) at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656) at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428) at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210) at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2492) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException at de.fme.jsconsole.CacheBackedChunkedList.get(CacheBackedChunkedList.java:49) at de.fme.jsconsole.CacheBackedChunkedList.get(CacheBackedChunkedList.java:16) at java.util.AbstractList$Itr.next(AbstractList.java:358) at java.util.AbstractCollection.toArray(AbstractCollection.java:141) at java.util.ArrayList.&amp;lt;init&amp;gt;(ArrayList.java:177) at de.fme.jsconsole.JavascriptConsoleScriptObject.getPrintOutput(JavascriptConsoleScriptObject.java:168) at de.fme.jsconsole.ExecuteWebscript.executeScriptContent(ExecuteWebscript.java:352)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Basicaly, I have a NPE and I cannot see where!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 05:23:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82168#M25235</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T05:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82169#M25236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how do you find &lt;STRONG&gt;userHome&lt;/STRONG&gt; space? can you check if &lt;STRONG&gt;userNode&lt;/STRONG&gt; is null without executing the copy action&lt;/P&gt;&lt;P&gt;please upload your script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 05:41:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82169#M25236</guid>
      <dc:creator>abbask01</dc:creator>
      <dc:date>2019-04-25T05:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82170#M25237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Abbas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my script (in work mode!)&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var user = document.properties["mr:User"];&lt;BR /&gt;logger.log(user);&lt;BR /&gt;var n = (user.split(" ").length - 1);&lt;BR /&gt; logger.log(n);&lt;/P&gt;&lt;P&gt;if (n === 0) {&lt;BR /&gt; var person=people.getPerson(user);&lt;BR /&gt; var mailAdr=person.properties.email;&lt;BR /&gt; logger.log(mailAdr)&lt;BR /&gt; var userNode = companyhome.childByNamePath("/User Homes/" + user);&lt;/P&gt;&lt;P&gt;var ref = userNode.nodeRef;&lt;BR /&gt; ref = "https://www.nirond-doc.net/share/page/repository#filter=path%7C%2FUser%2520Homes%2F" + user + "&amp;amp;page=1";&lt;BR /&gt; logger.log(ref);&lt;/P&gt;&lt;P&gt;document.copy(userNode);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function sendMail()&lt;BR /&gt;{&lt;BR /&gt; var mail = actions.create("mail");&lt;BR /&gt; mail.parameters.to = mailAdr;&lt;BR /&gt; mail.parameters.subject = "New (snail)mail";&lt;BR /&gt; mail.parameters.from = "mailroom@nirond.be";&lt;BR /&gt; mail.parameters.text = "The following mail is available: " + document.name + " in " + ref;&lt;BR /&gt; mail.execute(document);&lt;BR /&gt;}&lt;BR /&gt;sendMail();&lt;/P&gt;&lt;P&gt;} else {&lt;BR /&gt; var num = (user.split(" ").length);&lt;BR /&gt; &lt;BR /&gt; logger.log("num " + num);&lt;BR /&gt; var initials = (user.split(" "));&lt;BR /&gt; logger.log("initials " + initials);&lt;BR /&gt; var i;&lt;BR /&gt; for (i = 0; i &amp;lt; num; i++) {&lt;BR /&gt; logger.log(i);&lt;BR /&gt; &lt;BR /&gt; var ref;&lt;BR /&gt; var refer;&lt;BR /&gt; var userNode;&lt;BR /&gt; &lt;BR /&gt; var initCode = "ini" + i;&lt;BR /&gt; &lt;BR /&gt; var initial = initials[i];&lt;BR /&gt; logger.log("initial " + initial);&lt;BR /&gt; &lt;BR /&gt; var person=people.getPerson(initial);&lt;BR /&gt; var mailAdr=person.properties.email;&lt;BR /&gt; logger.log(mailAdr);&lt;BR /&gt; &lt;BR /&gt; var userNode = companyhome.childByNamePath("/User Homes/" + initial);&lt;BR /&gt; logger.log(userNode);&lt;BR /&gt; &lt;BR /&gt; var refer = "https://www.nirond-doc.net/share/page/repository#filter=path%7C%2FUser%2520Homes%2F" + initial + "&amp;amp;page=1";&lt;/P&gt;&lt;P&gt;/*document.copy(userNode);&lt;BR /&gt;/*&lt;BR /&gt;function sendMail()&lt;BR /&gt;{&lt;BR /&gt; var mail = actions.create("mail");&lt;BR /&gt; mail.parameters.to = mailAdr;&lt;BR /&gt; mail.parameters.subject = "New (snail)mail";&lt;BR /&gt; mail.parameters.from = "mailroom@nirond.be";&lt;BR /&gt; mail.parameters.text = "The following mail is available: " + document.name + " in " + ref;&lt;BR /&gt; mail.execute(document);&lt;BR /&gt;}&lt;BR /&gt;sendMail();&lt;BR /&gt;}*/&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 05:48:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82170#M25237</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T05:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82171#M25238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It all works until I do the copy(). If I have only one user, no problem!&lt;/P&gt;&lt;P&gt;That is why it is commented out!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 05:49:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82171#M25238</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T05:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82172#M25239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Latest news!&lt;/P&gt;&lt;P&gt;I found that the document.copy() does not work when inside a For loop!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 09:21:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82172#M25239</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T09:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82173#M25240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have reduced my script to the following but no success. Same problem!&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var user = document.properties["mr:User"];&lt;/P&gt;&lt;P&gt;var init = user.split(" ");&lt;/P&gt;&lt;P&gt;init.forEach(function(initial) {&lt;/P&gt;&lt;P&gt;var person = people.getPerson(initial);&lt;BR /&gt; var mailAdr = person.properties.email;&lt;/P&gt;&lt;P&gt;var userNode = companyhome.childByNamePath("/User Homes/" + initial);&lt;/P&gt;&lt;P&gt;document.copy(userNode);&lt;BR /&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I log the variables, they are all there!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 10:47:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82173#M25240</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T10:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problems copying a document to several userHome</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82174#M25241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved! But I don't know why!&lt;/P&gt;&lt;P&gt;I remove all the "Logger.log" and voila! It all works now!&lt;/P&gt;&lt;P&gt;Thank you Abbas for taking the time to answer!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 11:31:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-copying-a-document-to-several-userhome/m-p/82174#M25241</guid>
      <dc:creator>nimbus1958</dc:creator>
      <dc:date>2019-04-25T11:31:16Z</dc:date>
    </item>
  </channel>
</rss>

