<?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 override in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300334#M253464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys, what is the structure to create an AMP and override existing Java code in jar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jun 2016 19:24:22 GMT</pubDate>
    <dc:creator>litllel</dc:creator>
    <dc:date>2016-06-09T19:24:22Z</dc:date>
    <item>
      <title>override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300334#M253464</link>
      <description>Hi guys, what is the structure to create an AMP and override existing Java code in jar.Thks</description>
      <pubDate>Thu, 09 Jun 2016 19:24:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300334#M253464</guid>
      <dc:creator>litllel</dc:creator>
      <dc:date>2016-06-09T19:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300335#M253465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the Alfresco SDK, it's the easiest way to create an amp. It also has built-in examples of how to do most types of customisation as well that you can use as a base. &lt;/SPAN&gt;&lt;A href="http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html" rel="nofollow noopener noreferrer"&gt;http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 20:58:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300335#M253465</guid>
      <dc:creator>steven_okennedy</dc:creator>
      <dc:date>2016-06-10T20:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300336#M253466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ok, thanks and can I override a spring bean definition who is inside a jar. If yes, how can I do it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:01:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300336#M253466</guid>
      <dc:creator>litllel</dc:creator>
      <dc:date>2016-06-13T14:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300337#M253467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Spring configuration is based on what boils down to basically "last loaded wins!".&amp;nbsp; Alfresco's extension points are designed to have their spring context files loaded &amp;lt;em&amp;gt;after&amp;lt;/em&amp;gt; the standard out of the box ones, which means that to override a Spring bean in an extension project, all you need to do is put a bean in your module-context.xml file (or any files that are included from there) and it will override any existing bean with the same name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't really matter whether the original bean definition is included in the WEB-INF/classes directory of the war, or is bundled in one of the jar files.&amp;nbsp; The only thing you would need to worry about is if you are using multiple modules (AMPs) that attempt to override the same bean.&amp;nbsp; In this case the one that gets loaded last will take effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 16:30:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300337#M253467</guid>
      <dc:creator>steven_okennedy</dc:creator>
      <dc:date>2016-06-13T16:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300338#M253468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Steven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to override the Content retrieval webscript in alfresco 5.1 EE. I have copied the web-scripts-application-context.xml to the module's context folder and changed the class attribute to my custom class, keeping the bean id as it is. Now when i check in the repository webscript index page, the content.get webscript still points to the OOTB&amp;nbsp; service instead of my custom class. But the same was working in v4.1.9. Not sure if i am missing something here. Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nikhilesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 10:43:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300338#M253468</guid>
      <dc:creator>nikhilesh_s1vak</dc:creator>
      <dc:date>2016-07-08T10:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300339#M253469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Nikhilesh,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default your amp module will load one context file automatically, the module-context.xml file - any other context files you include won't be picked by Spring unless you tell it to.&amp;nbsp; So if you want to include a file called web-scripts-application-context.xml in your module's context folder you'll need to add an import in module-context.xml that looks something like &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;import resource="classpath:alfresco/module/${project.artifactId}/context/web-scripts-application-context.xml" /&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option is to copy just the bean that you're overriding into one of the existing context files that are already loaded, either module-context.xml itself or one of the other files that are imported from there by default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jul 2016 22:24:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300339#M253469</guid>
      <dc:creator>steven_okennedy</dc:creator>
      <dc:date>2016-07-10T22:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300340#M253470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Steven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I have imported the web-scripts-application-context.xml in the module-context file and copied the bean to the context file and to module-context file either. But both are not working in my case. As i mentioned earlier comment, the same was working in 4.1.9 but it is not an AMP deployment. I wonder this process might have changed in 5.x or they removed the support for overriding the OOTB beans.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nikhilesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 07:07:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300340#M253470</guid>
      <dc:creator>nikhilesh_s1vak</dc:creator>
      <dc:date>2016-07-12T07:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300341#M253471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Nikhilesh,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No they have not removed the ability to override beans, it's still provided as basic Spring functionality.&amp;nbsp; Are you using any other amps with your project that may also be overriding this bean?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It might be simplest if you post your module-context.xml &amp;amp; supporting files&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 12:33:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300341#M253471</guid>
      <dc:creator>steven_okennedy</dc:creator>
      <dc:date>2016-07-12T12:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300342#M253472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Steven, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for quick reply. Yes i am using another default amp "alfresco-share-services" with the project. But the other amp is not overriding anything related to content.get service except a bean in this amp is extending content.get but not overriding. Please find the attached the module-context file. The same bean declarations are removed from web-scripts-application-context file and added to module-context file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nikhilesh&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 13:05:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300342#M253472</guid>
      <dc:creator>nikhilesh_s1vak</dc:creator>
      <dc:date>2016-07-12T13:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: override</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300343#M253473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;After so many days of investigation and repeated failures i found a solution for the above issue which i thought i could end up finding any answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have kept these custom context files under the&lt;STRONG&gt; "classpath:alfresco/extension/custom-web-context.xml" &lt;/STRONG&gt;and the changes are picked up after the restart and my custom bean has overridden the OOTB beans.&lt;/P&gt;&lt;P&gt;I have found this information in the &lt;STRONG&gt;web-application-context.xml&lt;/STRONG&gt; file under the path &lt;STRONG&gt;&amp;lt;root&amp;gt;\tomcat\webapps\alfresco\WEB-INF&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="_jivemacro_uid_14767098739797394 jive_macro_code jive_text_macro" data-hasrefreshed="true" data-renderedposition="183_8_1239_80" jivemacro_uid="_14767098739797394"&gt;&lt;P&gt;&amp;lt;!--&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To give final control over the tuning of the custom environment, the custom-web-context.xml file is processed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; last (note: custom-web-context.xml isn't part of the source tree itself).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;import resource="classpath*:alfresco/extension/custom-web-context.xml" /&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone who is looking for an answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 13:10:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/override/m-p/300343#M253473</guid>
      <dc:creator>nikhilesh_s1vak</dc:creator>
      <dc:date>2016-10-17T13:10:29Z</dc:date>
    </item>
  </channel>
</rss>

