<?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: Developing a custom webapp with Alfresco embedded in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104250#M72800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Regarding #2, if the application context is already loaded via a Spring WebApplicationContext (which is how the web client does things), you can use the following code to obtain a reference to it (and from there a reference to the service registry):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplicationContext ctx = (ApplicationContext)request.getSession().getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceRegistry&amp;nbsp;&amp;nbsp;&amp;nbsp; reg = (ServiceRegistry)ctx.getBean("ServiceRegistry");&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;A minor simplification is to implement the ServletContextAware interface in your servlets and/or filters, and then follow the same steps above.&amp;nbsp; I've not tried this myself yet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2007 23:05:48 GMT</pubDate>
    <dc:creator>pmonks</dc:creator>
    <dc:date>2007-07-30T23:05:48Z</dc:date>
    <item>
      <title>Developing a custom webapp with Alfresco embedded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104249#M72799</link>
      <description>I am writing a proof-of-concept web application that embeds Alfresco and uses its repository services API.&amp;nbsp; Currently, I'm trying to flush out a few details.1. I have a simple servlet that grabs the application context and authenticates in the init() method, which will start up the embedded Alfresco</description>
      <pubDate>Thu, 26 Jul 2007 18:05:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104249#M72799</guid>
      <dc:creator>pitt1</dc:creator>
      <dc:date>2007-07-26T18:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Developing a custom webapp with Alfresco embedded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104250#M72800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Regarding #2, if the application context is already loaded via a Spring WebApplicationContext (which is how the web client does things), you can use the following code to obtain a reference to it (and from there a reference to the service registry):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplicationContext ctx = (ApplicationContext)request.getSession().getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceRegistry&amp;nbsp;&amp;nbsp;&amp;nbsp; reg = (ServiceRegistry)ctx.getBean("ServiceRegistry");&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;A minor simplification is to implement the ServletContextAware interface in your servlets and/or filters, and then follow the same steps above.&amp;nbsp; I've not tried this myself yet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 23:05:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104250#M72800</guid>
      <dc:creator>pmonks</dc:creator>
      <dc:date>2007-07-30T23:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Developing a custom webapp with Alfresco embedded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104251#M72801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the tip!&amp;nbsp; I have found that the web client does this slightly differently, using a spring method to grab the web application context:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(context);&lt;BR /&gt;ServiceRegistry serviceRegistry = (ServiceRegistry) wc.getBean(ServiceRegistry.SERVICE_REGISTRY);&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 00:13:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104251#M72801</guid>
      <dc:creator>pitt1</dc:creator>
      <dc:date>2007-07-31T00:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Developing a custom webapp with Alfresco embedded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104252#M72802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nice!&amp;nbsp; I didn't know that that Spring API existed!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 00:51:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/developing-a-custom-webapp-with-alfresco-embedded/m-p/104252#M72802</guid>
      <dc:creator>pmonks</dc:creator>
      <dc:date>2007-07-31T00:51:13Z</dc:date>
    </item>
  </channel>
</rss>

