Tom's Blog
The footer says:
Supplied free of charge with no support, no certification, no maintenance, no warranty and no indemnity by Alfresco or its Certified Partners. Click here for support. Alfresco Software Inc. © 2005-2009 All rights reserved.The footer includes Alfresco's logo by reading an image from the Alfresco website. This image is called a web bug, or beacon, and Alfresco can use the image request to their server to help track who is using Alfresco. The footer's underlined text links to pages on the alfresco.com website to provide warnings that the Labs version of Alfresco is not supported by Alfresco Software Inc. The right-side graphic links you to Alfresco's SourceForge download site.
Except for the web beacon image, I don't fault Alfresco Software for adding the footer to its web client. Alfresco Labs is a powerful -- free -- and flexible product. If used within an organization, it is not a bad thing that users are made aware that the product is not the supported Enterprise version. However, since I am using Alfresco on an internal website, and plan to customize the various JSP pages, displaying the warning on every one of my pages seems overkill and unnecessary. And I could do without sending tracking statistics to Alfresco Software.
Removing the global footer isn't a simple process, but it is pretty straightforward. The removal should be as simple as editing a globally included text file. Instead, those clever developers at Alfresco embedded the footer text into a fairly useful JSP tag. This
<r:page>
JSP tag outputs the skeletal HTML page tags,
and includes HTML to pull in global scripts and cascading stylesheets.
It also includes code that can log how long it took Alfresco to build the JSP page.
To remove the footer from your web pages,
you need either to stop using the
r:page
tag or recompile the page tag to set the text to what you would like,
which is what the instructions below cover.
Recompiling the
r:page
tag that lives in the Alfresco web client JAR file isn't complicated.
Assuming you already are using the Alfresco Labs 3 web application,
the process should take you a half hour or less,
with most of that time spent downloading and compiling code.
Overview
The steps below show you how to obtain the complete source code to Alfresco, make the necessary change to the Java page tag code, rebuild the web client JAR file, then replace the existing JAR file in your Alfresco server with the newly built one.
Prerequisites: You must have a Java compiler, a Subversion client, Apache Ant, and be able to use the command line. For Windows users without Subversion, you can install the SlikSVN client. Others can find a link to download a Subversion client from CollabNet's Tigris.org.
Instructions
Here are the steps to rebuild the Alfresco web client with the altered JSP page tag. (You should be able to cut and paste these lines onto your command line if you remove the prompt character.)
- Create an empty directory for the source code
% mkdir alfresco-labs % cd alfresco-labs - Use Subversion to download the Alfresco Labs source code
% svn co svn://svn.alfresco.com/alfresco/HEADor use the http protocol if you have internal firewall issues:% svn co http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEADThesvncommand will connect to the Alfresco Subversion repository and copy each of the files in the HEAD branch into your local directory. Total download size will be about 734MB. Depending on the speed of your connection, this might be a good time to get coffee, have lunch, check your email. If the Subversion URL doesn't work, check this page to see if Alfresco has changed the repository location.
- Edit
PageTag.javato change/remove the page footer text
ThePageTag.javafile you want to edit is in the directoryHEAD/root/projects/web-client/source/java/org/alfresco/web/ui/repo/tag. The commands below will edit the file in Notepad for Windows or vi for Unix/Mac users. But you also can just navigate to the folder and edit the file with any editor.
For Windows:% notepad HEAD\root\projects\web-client\source\java\org\alfresco\web\ui\repo\tag\PageTag.javaFor Unix variants:$ vi HEAD/root/projects/web-client/source/java/org/alfresco/web/ui/repo/tag/PageTag.javaAt this point, you can decide what you want your new page footer text to say. The quickest edit is to completely remove all footer contents by changing line 115:private static String alfresco = null;to:private static String alfresco = "";Why this works is that staticalfrescovariable holds the contents of the page footer HTML (images and text), which is output by the overridden JSP tag library methoddoEndTag. If thealfrescovariable is null, which it is the first time the code is run, thedoEndTagmethod calls a private helper method,getAlfrescoButton, to populate it.
If you want to change the footer text to something of your own choosing, or perhaps you want to retain the Alfresco copyright notice because you won't be changing the web client's look and feel, you will want either to set thealfrescovariable to the text of your choosing, or edit thegetAlfrescoButtonmethod and/or some of the variables it uses to build up the footer text.
For example, if you want to retain the copyright statement but remove the warning text, edit theALF_COPYconstant on lines 103-112 to remove the text you don't want:private final static String ALF_COPY = "Supplied free of charge with " + "<a class='footer' href='http://www.alfresco.com/services/support/communityterms/#support'>no support</a>, " + "<a class='footer' href='http://www.alfresco.com/services/support/communityterms/#certification'>no certification</a>, " + "<a class='footer' href='http://www.alfresco.com/services/support/communityterms/#maintenance'>no maintenance</a>, " + "<a class='footer' href='http://www.alfresco.com/services/support/communityterms/#warranty'>no warranty</a> and " + "<a class='footer' href='http://www.alfresco.com/services/support/communityterms/#indemnity'>no indemnity</a> by " + "<a class='footer' href='http://www.alfresco.com'>Alfresco</a> or its " + "<a class='footer' href='http://www.alfresco.com/partners/'>Certified Partners</a>. " + "<a class='footer' href='http://www.alfresco.com/services/support/'>Click here for support</a>. " + "Alfresco Software Inc. © 2005-2009 All rights reserved.";If you want to keep some of the text but remove the web beacon image or SourceForge graphic, you will need to edit thegetAlfrescoButtonmethod or set thealfrescovariable as discussed previously.
Fortunately, thegetAlfrescoButtonmethod does not add structural HTML text to the footer, so setting thealfrescovariable directly with your chosen text is a viable option. If you use HTTPS on your website and you want to use an image in your footer, have a look at the technique used in thegetAlfrescoButtonmethod to change the image URL based on the request scheme. It's a handy way to avoid having web browsers complain about an encrypted page using non-encrypted components.
With the code edited, you are ready to rebuild Alfresco. - Rebuild the web client application
Here is where you need Ant. Use the build target to rebuild the project modules. The default target will attempt to deploy the rebuilt WAR file, so make sure to use the "build" target.
For Windows:% ant -f HEAD\root\build.xml buildFor Unix:$ ant -f HEAD/root/build.xml buildYou will see several warnings about the use of deprecated methods and the like. But the code should build correctly.
The Ant task should rebuild the Alfresco JAR files and the WAR file. The rebuiltalfresco-web-client.jarfile is the one that contains the repository JSP tag you want to replace. The Ant task creates this JAR file in the directoryHEAD/root/projects/web-client/build/dist. - Copy the alfresco-web-client.jar to your Alfresco webapp
Copy the JAR file to your exploded WAR file directory location under theWEB-INF/libdirectory. If you deploy Alfresco as WAR file rather than exploded WAR, you can use the fullalfresco.warfile that you also will find in theHEAD/root/projects/web-client/build/dist. directory.
Gone is the footer from this and all Alfresco web client pages.
Wednesday March 04, 2009 Permalink
Comments [10]
Excellent post. I follow the exact instructions but I still get the original footer. Any suggestions?
I'm running Alfresco Labs v3.0.0 (Stable 1526) on Windows 2003 Server with MySQL.
Posted by David G on March 23, 2009 at 07:57 PM EST #
Sorry for the difficulty. I can think of a few things that could have gone wrong. Do any of these sound plausible? -- you modified the wrong Java file, your modifications to the PageTag.java class didn't get compiled or built into the JAR, the JAR didn't get installed into the WAR, or your application server is caching the prior contents of the rendered JSP? Did you see any errors during the Ant build process?
-Tom
Posted by Tom McQueeney on March 23, 2009 at 09:12 PM EST #
1. I'm sure I modified the correct file according to your instructions, it was in the folder you mention and the JAR and WAR files also was in the folder expected. Also I open the JAR file with WinRAR and navigate to the object and I can saw the modifications I made.
2. I use the WAR file and exploded and also I use the JAR file but with the same results, the footer is the same, no modifications.
3. About the server caching JSP, my initial thoughts was something about that, but I restart Tomcat, the server, and even drop the MySQL database and create again. Also I delete all the temp files that Tomcat use.
4. I got a lot of warnings during the Ant building but you said is ok.
Maybe "those clever developers" change something and this not work with my build?
Thank you very much for your help.
Posted by David G on March 25, 2009 at 12:01 PM EST #
If you're still have problems, go ahead and email me (address is in the right column of my home page) and I'll see if I can offer advice. Alfresco engineers did recently update the PageTag Java class to remove the SourceForge graphic from the standard footer, but my instructions for rebuilding the web client should still work. I'm using the latest source code and Ant build from HEAD, so maybe you have a different source snapshot that needs a different Ant target?
-Tom
Posted by Tom McQueeney on March 26, 2009 at 10:41 PM EST #
java.lang.NoClassDefFoundError: org/alfresco/service/cmr/invitation/InvitationService
caused by:
java.lang.ClassNotFoundException: org.alfresco.service.cmr.invitation.InvitationService
Hide Details
java.lang.NoClassDefFoundError: org/alfresco/service/cmr/invitation/InvitationService
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:472)
at org.apache.myfaces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:325)
at org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(ManagedBeanBuilder.java:177)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:55)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:314)
at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:108)
at org.alfresco.web.app.AlfrescoVariableResolver.resolveVariable(AlfrescoVariableResolver.java:94)
at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:570)
at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
at org.alfresco.web.app.servlet.FacesHelper.getManagedBean(FacesHelper.java:168)
at org.alfresco.web.bean.wizard.WizardManager.setCurrentWizard(WizardManager.java:113)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleWizardOpen(AlfrescoNavigationHandler.java:667)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleNavigation(AlfrescoNavigationHandler.java:120)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:82)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.alfresco.service.cmr.invitation.InvitationService
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 46 more
Return to application
$$return_home$$
Logout
kindly assist
Posted by moses on April 08, 2009 at 10:07 AM EDT #
Interesting problem. Changing the PageTag class should have nothing to do with this class loading issue, but maybe the rebuilding Ant task did something wrong.
From the stack trace, it looks like the InvitationService class isn't being found by the Tomcat WebappClassLoader classloader. That class is packaged in the alfresco-repository.jar, which *should* be in your alfresco webapp's deployed WEB-INF/lib directory. Maybe Alfresco broke something in HEAD they later fixed, and if you refresh the code from HEAD and rebuild, maybe the problem is fixed.
If not, I'd suggest you check that your Ant build command packaged the alfresco-repository.jar file into the WAR, and that the JAR file contains the InvitationService interface (and its Impl class). I would think that if your WAR file didn't have the alfresco-repository.jar file, you would have seen a LOT of other errors.
If you do see the InvitationService class files in the alfresco-repository.jar, then the problem sounds like it is related to how Alfresco is loading classes when running an advanced workflow. If this is the case, it sounds like an Alfresco bug. You could always check out the code from HEAD again, rebuild Alfresco w/o making the changes to the page tag library, confirm it is a bug and report the bug to Alfresco.
Good luck.
-Tom
Posted by
Tom McQueeney
on April 08, 2009 at 04:04 PM EDT
Website: http://mcqueeney.com/
#
I'm trying to apply your nices instructions, but i have a problem as it dont't work.
i think it doesn't work because :
- I have the Alfresco 3.0 Labs revision 12844 to patch
- I used subversion to get the source and download the revision 14028
- I follow your instructions and at the end, copy the .jar in the WEB-INF/lib directory
- I start the Alfresco server and have several errors that makes stop the server
Do you think that it's because the revisions are differents that it doesn't work
And if you think so, is there a way to get the rev. 12844 source anywhere ?
Many thanks
Fred.
Posted by Fred on April 22, 2009 at 06:29 AM EDT #
I think you diagnosed your problem correctly. You replaced the alfresco-web-client.jar into an Alfresco build that was too old and thus incompatible. My instructions would have been better if I had said they assume you have are starting from a fresh build of Alfresco from which you want to remove the footer. Deploying just the new web client JAR file into an older Alfresco build definitely could cause problems. Sorry for your difficulty.
Regarding obtaining an earlier snapshot of the Alfresco source code, I don't know. I have never looked into the public Alfresco subversion repository to see if you can get a version other than HEAD. However, if you have no prohibition against upgrading to the latest release from HEAD, Step 4 of the instructions above created a new WAR file as well as a new alfresco-web-client.jar file. Deploying that WAR file might solve your problem. The latest Alfresco version in HEAD is Alfresco Labs 3.2 preview release. It includes some database changes in addition to code changes from the earlier versions of Labs 3.0 final. When I upgraded recently to 3.2, it worked with my existing data directory and lucene indexes.
If you cannot upgrade to the latest Alfresco WAR file, you can try just replacing the PageTag.class file inside your *old* alfresco-web-client.jar file. You'll need to unzip the old JAR file, replace the PageTag.class file in the "org/alfresco/web/ui/repo/tag directory, then re-zip the whole set into a new alfresco-web-client.jar file. I recently looked at the new PageTag.java file, and I believe no incompatible updates have been made to it. Good luck.
-Tom
Posted by Tom McQueeney on April 22, 2009 at 09:35 AM EDT #
As i cannot upgrade my alfresco application,
I have follow your explanation to replace the PageTag.class... and it works now very well.
I have no more footer on my pages
THANKS A LOT
Fred.
Posted by Fred on April 27, 2009 at 10:37 AM EDT #
Posted by Ankita Verma on July 01, 2009 at 08:03 AM EDT #


