cancel
Showing results for 
Search instead for 
Did you mean: 

Changes to source code not used in build.

jeremy
Champ in-the-making
Champ in-the-making
Hi,

When I change the Alfresco source code, and then rebuild alfresco, the old alfresco code is used in the build, rather than the changes I made.

I tried to change the code in the file simple-title.get.html.ftl from

<div class="page-title theme-bg-color-1 theme-border-1">
   <h1 class="theme-color-3"><span>${msg(args.title)}</span> <#if args.subtitle?? && msg(args.subtitle) != args.subtitle>${msg(args.subtitle)}</#if></h1>
</div>

to

<div class="page-title theme-bg-color-1 theme-border-1">
   <h1 class="theme-color-3"><span>Jeremy</span> <#if args.subtitle?? && msg(args.subtitle) != args.subtitle>${msg(args.subtitle)}</#if></h1>
</div>

However, after the build is completed, the former code is getting used. I know that the initial code gets used because after the build I opened the simple-title.get.html.ftl from Tomcat (i.e. in apache-tomcat-6.0.29/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/title) and it has the old code.

I think the problem might have something to do with svn.

Thanks.
7 REPLIES 7

mikeh
Star Contributor
Star Contributor
Please detail exactly what steps you take from editing, through build and deployment.

Thanks,
Mike

jeremy
Champ in-the-making
Champ in-the-making
Hi,

To edit the file simple-title.get.html.ftl I open it from the file system (C:\Alfresco\projects\slingshot\config\alfresco\site-webscripts\org\alfresco\components\title). It opens in a program called Notepad++.
I make the required changes, and save the file. To save the file I press the control key and s. I know it saves because when i close this file, and then reopen the file, it has my changes.

Next, in Netbeans, I have the file c:\Alfresco\build.xml open. In the navigator panel in NetBeans, I right click on the 'build-tomcat' option, and select 'Run Target'. NetBeans then does a successful build.

For some reason share.war (produced from the build)  gets copied to a folder in c:\Alfresco so I manually copy it from here to the webapps folder in the Tomcat installation.
The file alfresco.war is where is should be (i.e. in the webapps folder of the Tomcat installation).

I then start Tomcat and wait for around 1-2 minutes.

Then I navigate to localhost:8080/share using Mozilla, and login. I navigate to the repository to see if the text "Repository Browser" has changed in accordance with my changes to simple-title.get.html.ftl. The text is unchanged.

I then check the simple-title.get.html.ftl in the tomcat installation (apache-tomcat-6.0.29\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\title) and it does not have the changes I made.

Thanks.

mikeh
Star Contributor
Star Contributor
Are you sure the share.war is getting redeployed by Tomcat? Try manually deleting the webapps/share folder.

Thanks,
Mike

jeremy
Champ in-the-making
Champ in-the-making
Thanks.

The problem is that when I do a re-build, the Share folder in Tomcat's webapps directory does not get deleted, but the Alfresco folder does.

Do you know how I can fix this, i.e. make a change so that the Share folder in the Tomcat installation does get deleted during a build ?

mikeh
Star Contributor
Star Contributor
Make sure the APP_TOMCAT_HOME environment variable is set to the same value as TOMCAT_HOME.

Thanks,
Mike

jeremy
Champ in-the-making
Champ in-the-making
Thanks, that worked.

After I make a change to the source code, such as the change I described above (i.e. changing the file simple-title.get.html.ftl), I then rebuild Alfresco to see if my change to the code works as I expect.

Rebuilding Alfresco normally takes anywhere between 5 and 20 minutes.

Is there a quicker way of building Alfresco, so that I can test my code changes more quickly ?

Thanks.

mikeh
Star Contributor
Star Contributor
You're only changing share, so just rebuild the slingshot project.
ant incremental-slingshot-tomcat

Thanks,
Mike