AnsweredAssumed Answered

How to properly specify source and target packages for Spring Surf Class Loader?

Question asked by Aleksey Bykov on Dec 5, 2017
Latest reply on May 13, 2018 by Aleksey Bykov

I am using Alfresco 4.2.2 Enterprise Edition and using Jar files to make customizations.


I can customize the My Tasks dashlet, for example. The source files that I want to customize are located in the path:




To customize the dashlet, I create the following directory structure:


C:\Users\bykov_an>tree C:\EclipseWorkspaces\alfresco\my-tasks-customization-example /F

│   .classpath
│   .project
│   build.xml

│       org.eclipse.jdt.core.prefs

│   └───lib
│           my-task-customization-example.jar

    │   ├───site-data
    │   │   └───extensions
    │   │           my-tasks-customisation.xml
    │   │
    │   └───site-webscripts
    │       └───mytasks
    │           └───customization
    │                   task-list.get.html.ftl




         <id>My Tasks customization</id>




<@markup id="additional-content" target="js" action="replace" scope="global">
   <@script src="${url.context}/res/components/workflow/workflow-actions.js" group="workflow"/>
   <@script src="${url.context}/res/components/workflow/task-list-custom.js" />




Ant script that I use:


<?xml version="1.0" encoding="UTF-8"?>
<project default="deploy-jar">

     <property name="" value="my-task-customization-example.jar"/>    
     <property name="jar.deploy.dir" value="C:\alfresco\customizations"/>

     <property name="project.dir" value="."/>
     <property name="build.dir" value="${project.dir}/build"/>
     <property name="jar.file" value="${build.dir}/lib/${}"/>

     <target name="mkdirs">
          <mkdir dir="${build.dir}/lib" />
     <target name="package-jar" depends="mkdirs">
          <jar destfile="${jar.file}" >
               <fileset dir="${project.dir}/config" includes="**/*" />
     <target name="deploy-jar" depends="package-jar">
          <copy file="${jar.file}" todir="${jar.deploy.dir}"/>
     <target name="clean">
          <delete file="${jar.file}"/>
          <delete file="${jar.deploy.dir}/${}"/>



It all works perfectly: I placed my-task-customization-example.jar in \share\WEB-INF\lib, then reboot the server and see the changes that I made.


The problem is that I need to customize one of the FreeMarker templates, that is placed in the following path:




Ie first in the directory web-extension, then in the directory site-webscripts. I created a similar directory structure, in several variations - but I didn't achieve the effect, I can't customize this template...


I can place the extension config file in /alfresco/site-data/extensions or in /alfresco/web-extension/site-data/extensions/ and in both cases it pick up successfully.


What am I doing wrong? How to customize FreeMarker template located in /web-extension/site-webscripts/ folder?


I would be very grateful for the information. Thanks to all.