<?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: Adding custom Java Objects in Freemarker Model in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281205#M234335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The Spring context file is in classpath:alfresco/module/${project.artifactId}/context/service-context.xml and the compiled class had been packed in a jar in the generated amp file.&lt;/P&gt;&lt;P&gt;I've put a breakpoint in org.alfresco.repo.processor.BaseProcessorExtension#register() and saw that the TemplateExtension I created was registered against the FreeMarkerProcessor as are the standard ones (xmldate for instance).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14775844096759496 jive_text_macro" data-hasrefreshed="true" data-renderedposition="133_8_1332_64" jivemacro_uid="_14775844096759496"&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;register()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;processor&lt;/SPAN&gt;.registerProcessorExtension(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;this&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cedric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 16:07:18 GMT</pubDate>
    <dc:creator>cedric_lamalle</dc:creator>
    <dc:date>2016-10-27T16:07:18Z</dc:date>
    <item>
      <title>Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281203#M234333</link>
      <description>Hello,I'm creating a custom form control and to render it I need to add custom java objects in the FreeMarker Model. From the documentation at Template models | Alfresco Documentation&amp;nbsp; it seems to be possible to add this objects from a Spring Configuration. I've tried to search through Alfresco Sour</description>
      <pubDate>Thu, 27 Oct 2016 10:41:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281203#M234333</guid>
      <dc:creator>cedric_lamalle</dc:creator>
      <dc:date>2016-10-27T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281204#M234334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where did you put your Spring context file and your compiled class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were there any errors reported in the log other than the InvalidReferenceException?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 15:32:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281204#M234334</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-10-27T15:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281205#M234335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The Spring context file is in classpath:alfresco/module/${project.artifactId}/context/service-context.xml and the compiled class had been packed in a jar in the generated amp file.&lt;/P&gt;&lt;P&gt;I've put a breakpoint in org.alfresco.repo.processor.BaseProcessorExtension#register() and saw that the TemplateExtension I created was registered against the FreeMarkerProcessor as are the standard ones (xmldate for instance).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14775844096759496 jive_text_macro" data-hasrefreshed="true" data-renderedposition="133_8_1332_64" jivemacro_uid="_14775844096759496"&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;register()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;processor&lt;/SPAN&gt;.registerProcessorExtension(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;this&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cedric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 16:07:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281205#M234335</guid>
      <dc:creator>cedric_lamalle</dc:creator>
      <dc:date>2016-10-27T16:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281206#M234336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm attaching the log from the start of Tomcat until the error and the structure of the generated AMP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:12:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281206#M234336</guid>
      <dc:creator>cedric_lamalle</dc:creator>
      <dc:date>2016-10-27T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281207#M234337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've taken your Spring bean, your Java class, and your freemarker snippet and ran them successfully unchanged, all within the repo tier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you may be defining your bean in the repo tier, but then you are trying to run freemarker in the Share tier. Those are two completely different web applications, so if you want to use your Freemarker extension in the Share tier, you need to put your context file in the Share web app instead of the repo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 21:23:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281207#M234337</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-10-28T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom Java Objects in Freemarker Model</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281208#M234338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOH!&lt;/P&gt;&lt;P&gt;You're right. They really are two different beasts!&lt;/P&gt;&lt;P&gt;In Share the only way I've found until now to customize the template is to override webscripts.container:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14777665320767263 jive_text_macro" data-hasrefreshed="true" data-renderedposition="158_8_1332_400" jivemacro_uid="_14777665320767263"&gt;&lt;P&gt;&amp;lt;bean id="webscripts.container" parent="webscripts.abstractcontainer" class="org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="name"&amp;gt;&amp;lt;value&amp;gt;Surf Container&amp;lt;/value&amp;gt;&amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="registry" ref="webscripts.registry" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="searchPath" ref="webframework.webscripts.searchpath" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="templateProcessorRegistry" ref="webframework.webscripts.registry.templateprocessor" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="scriptProcessorRegistry" ref="webframework.webscripts.registry.scriptprocessor" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="scriptParameterFactoryRegistry" ref="webscripts.web.scriptparameterfactoryregistry" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="configService" ref="web.config" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="scriptObjects"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;map merge="true"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;entry key="remote" value-ref="webframework.webscripts.scriptremote" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/map&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="processorModelHelper" ref="processor.model.helper"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="extensibilityModuleHandler" ref="webscripts.extensibility.handler"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="urlModelFactory" ref="url.model.factory"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Override default Template Model --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;property name="templateObjects"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;map merge="true"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;entry key="jsonToModel"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean class="br.gov.mpog.pocpdc.JsonTemplateExtension" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/entry&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/map&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen that Spring Surf overrides the webscripts.container in spring-surf/src/main/resources/org/springframework/extensions/surf/spring-surf-application-context.xml that is already defined in Spring WebScripts spring-webscripts/src/main/resources/org/springframework/extensions/webscripts/spring-webscripts-application-context.xml, so this is why I'm using LocalWebScriptRuntimeContainer to override webscripts.container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2016 18:42:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-custom-java-objects-in-freemarker-model/m-p/281208#M234338</guid>
      <dc:creator>cedric_lamalle</dc:creator>
      <dc:date>2016-10-29T18:42:30Z</dc:date>
    </item>
  </channel>
</rss>

