<?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: Cannot find NodeService instance trying to reproduce Alfresco Wiki examples in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298804#M251934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just as you pointed out, I was missing the Spring beans configuration. Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jul 2013 21:51:18 GMT</pubDate>
    <dc:creator>ardamose123</dc:creator>
    <dc:date>2013-07-15T21:51:18Z</dc:date>
    <item>
      <title>Cannot find NodeService instance trying to reproduce Alfresco Wiki examples</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298802#M251932</link>
      <description>I was following the instructions in "Custom Actions" (http://wiki.alfresco.com/wiki/Custom_Actions). However, when I get to the executeImpl(…)‍ method, Java cannot find the this.nodeService‍ object.public void executeImpl(Action action, NodeRef actionedUponNodeRef){&amp;nbsp;&amp;nbsp; if (this.nodeService.exists(act</description>
      <pubDate>Thu, 11 Jul 2013 22:50:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298802#M251932</guid>
      <dc:creator>ardamose123</dc:creator>
      <dc:date>2013-07-11T22:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find NodeService instance trying to reproduce Alfresco Wiki examples</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298803#M251933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ardamose,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually you'll need a bit of spring background to understand it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your class, to be picked up by Alfresco, will need to be declared in a config file via a been. It will be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;bean id="add-aspect" class="org.alfresco.repo.action.executer.AddAspectActionExecuter" parent="action-executer"&amp;gt;&amp;lt;/bean&amp;gt;&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;BR /&gt;&lt;SPAN&gt;With this bean, you can inject other beans that will be available in your class. In our case: the nodeService&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;bean id="add-aspect" class="org.alfresco.repo.action.executer.AddAspectActionExecuter" parent="action-executer"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="nodeService"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="nodeService" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And for spring to be able to inject it, you'll need the appropriate setter in jour java code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you'll want to add this at the begining of your java class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;private NodeService nodeService;&lt;BR /&gt;public void setNodeService(NodeService nodeService)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.nodeService = nodeService;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you should be able to access your&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;this.nodeService&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2013 08:21:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298803#M251933</guid>
      <dc:creator>scouil</dc:creator>
      <dc:date>2013-07-12T08:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find NodeService instance trying to reproduce Alfresco Wiki examples</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298804#M251934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just as you pointed out, I was missing the Spring beans configuration. Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 21:51:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-find-nodeservice-instance-trying-to-reproduce-alfresco/m-p/298804#M251934</guid>
      <dc:creator>ardamose123</dc:creator>
      <dc:date>2013-07-15T21:51:18Z</dc:date>
    </item>
  </channel>
</rss>

