02-16-2018 09:52 AM
Hi,
I'm trying to update my-tasks.get.html.ftl file on one of my Tomcat, but I when I log in I cannot see any changes. I'm simply trying to add another button (<span> element) in this file, and I have uploaded the modified version inside :
d:\alfresco-community\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\dashlets\
But it doesn't work - old content is still shown. When I log out and log in again, I can still see the old version of my dashlet. I've tried everything :
- restarted Tomcat - nothing
- removed and re-added dashlet again - still the same
- went to share/page/index and clicked "Refresh Web Scripts" blue button at the bottom - still the same
- went to alfresco/service/index and clicked on the same button - again, not updated
i haven't modified anything else.
Am I missing something? How can I update this HTML presentation part of my tasks dashlet?
I'm using Alfresco Community 5.2 installed on Windows 7 as a service.
Thanks in advance
02-22-2018 01:24 PM
Just realized problem was smth completely else. I tottaly forgot I had an extra share JAR module installed (it's in WEB-INF\lib under share) and it had another copy of this file, clearly unmodified. This version takes presence over anything that's inside share.war (and tomcat\shared as well). This copy didn't show in my file searches because it was inside JAR file (module).
I can now finally close this thread.
02-16-2018 06:27 PM
After you start the service, if you navigate into that folder, do you still see your changed file in there?
I am asking you this because you are changing a file directly inside the share app (share expanded folder or share.war), and that is not a good practice, as when Tomcat starts, it can redeploy the application, and have your file removed.
The right thing to do is to extend the ftl file using the extension method.
A quick test is to move your changed file into the following path:
d:\alfresco-community\tomcat\shared\classes\alfresco\web-extension\alfresco\site-webscripts\org\alfresco\components\dashlets\
Do this, restart the service and try again.
02-17-2018 06:55 AM
Hi Douglas,
Yup, still there...hasn't been overwritten. Share.war is always present and since the war file is already exploded, Tomcat will persist my changes in files across restarts.
I've tried to move the file as you suggested (created all the missing directories) and still the same - new content simply won't load. Tried to restart, refresh web scripts - no luck. Interestingly, when I run my demo project over maven (using mvn alfresco:run) I can always see my changes.
Do I need to re-create share.war and re-deploy on the server? What if I enable Tomcat manager and reload the share webapp, would that help?
Thanks
02-17-2018 07:25 PM
What folders you had to create, exactly?
02-18-2018 04:08 AM
web-extension folder didn't have any subfolders inside (it had only one file custom-slingshot-application-context.xml.sample). I had to create the whole path under web-extension alfresco\site-webscripts\org\alfresco\components\dashlets
The whole path now looks like this :
d:\alfresco-community\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\alfresco\site-webscripts\org\alfresco\components\dashlets\my-tasks.get.html
Do I need to create a module instead using maven and deploy it to Alfresco?
02-19-2018 08:20 AM
Sorry. I have just noticed I sent the wrong path to you.
Please, remove the alfresco folder just after web-extension, and try again.
The full path should be
d:\alfresco-community\tomcat\shared\classes\alfresco\web-extension\site-webscripts\org\alfresco\components\dashlets\my-tasks.get.html
But please, pay attention for something. It is not inside the share application folder. It is inside the shared folder, inside toncat, which is the right place to put your extension files.
02-20-2018 11:50 AM
Yes, You were right, I was copying it under webapps\share. Tried as you suggested but still the same. Tried both with and without alfresco under tomcat\shared and no luck (even after restart).
Any documentation references I could read? I guess we're missing smth.
Thanks
02-20-2018 12:29 PM
You can rely on the official documentation: Modifying Out-of-the-box Surf Web Scripts | Alfresco Documentation
If you can, please, share your project.
02-21-2018 12:38 PM
Thanks I'll look at this.
Is there a some sort of template caching mechanism or similar? How can I force templates to reload, do I need to delete some folder maybe?
Btw, I tried to reload the share webapp from Tomcat's manager...and still the same. I'm starting to wonder am I editing the right file...
Thanks
02-22-2018 08:53 AM
OK, I finally solved this darn thing. I had to delete the share folder under webapps, rebuild the share.war file
and let Tomcat unpack this file during bootup. When I logged in again, everything showed.
Funny thing, reloading webapp didn't work, not sure why.
Closing the issue.
Explore our Alfresco products with the links below. Use labels to filter content by product module.