Home

Url.serverPath variable

You are here

25 posts / 0 new
Last post
Url.serverPath variable

In which configuration file should I change url.serverPath variable in order to receive email notifications with links that look like "http://myservername:8080/alfresco..." and not like "http://localhost:8080/alfresco..."?

Now I have to change my email notification templates with replacing this variable by exact address of my server.

Re: Url.serverPath variable

I do not think that you have this, urls are hardcoded into templates. so just change templates fixes in 2 min.

if you are working with multitenant configuration change files on hard disc.

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

savic.prvoslav wrote:
I do not think that you have this, urls are hardcoded into templates. so just change templates fixes in 2 min.

if you are working with multitenant configuration change files on hard disc.

You can't be serious!

That would mean you couldn't deploy the same template into UAT and then into production without changing them?

Re: Url.serverPath variable

well look at the code for your self.

but it is not hard to manipulate with the text in the file and replace the string for localhost... with your server. this is one way anyway.

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

I agree it's hard to believe that localhost:8080 has been hardcoded in the template...

I updated my notify_user_email.ftl with the correct production server name but the system isn't picking up the changes to the template and continues to send emails with localhost:8080. How do I get the system to reload the .ftl template so the changes are reflected in the UI?

Thanks,

Tim

Re: Url.serverPath variable

Figured it out - changes to the ftl templates must be done through the Alfresco Explorer.

1-Navigate to the template - Company Home > Data Dictionary > Email Templates > Notify Email Templates
2-Check out and edit template
3-Check in template
4-All is good....

Tim

Re: Url.serverPath variable

Okay, I can do this but it seems ridiculous. Is it true that there isn't another variable to can be used instead of url.serverPath so that we don't get

localhost:8080?

Or, can url.serverPath be set somewhere to something less generic?

Dan Gruhn
Group W Inc.

Re: Url.serverPath variable

you can add feature to correct content of that files

ContentWriter contentWriter = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getContentService()
.getWriter(associationRef.getChildRef(),
ContentModel.PROP_CONTENT, true);

ContentReader contentReader = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getContentService()
.getReader(associationRef.getChildRef(),
ContentModel.PROP_CONTENT, true);

just read replace strings and write in same file . easy.

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

Savic,

What file are you talking about changing?

How does this change the effect the value of url.serverPath?

Perhaps I need a more specific example.

Dan Gruhn
Group W Inc.

Re: Url.serverPath variable

My comany > Data Dictionary > Email Templates
hire you have files witch are used as email templates
if you look the text from the files , you will see that they have http://yourserver:8080 or something like that.

all you have to do is change content of files by hand or to create some dialog or else using code that I have send you to change content to mach your server.

for instance tenant.somehost.com (or what ever else)

--------------------------------------
also other files have this problem like rss and so on.
--------------------------------------
for my company I have developed system that there is invite template for each language ( en, hr, rs) so correct template is used for each moment regarding of default language of the tenant.

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

Figured it out - changes to the ftl templates must be done through the Alfresco Explorer.

1-Navigate to the template - Company Home > Data Dictionary > Email Templates > Notify Email Templates
2-Check out and edit template
3-Check in template
4-All is good....

Tim

this is good solution :)
but it is a bit not nice, use my code to create dialog defined for admin to automaticly correct the paths to your server .

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

Odd. While testing invite I was logged into share via IP (http://10.1.1.1:8080/share). Invite sent accept path as http://10.1.1.1:8080/share/invite_etc.

Later I logged in using server host name http://ubu.domain.com:8080/share). Invite sent accept path as http://ubu.domain.com:8080/share/invite_etc.

To confirm I gave server another DNS entry and logged into http://alfresco.domain.com:8080/share. Sure enough invite sent accept path as http://alfresco.domain.com:8080/share/invite_etc.

Appears Alfresco is taking path from the url YOU are logging into. Hope this helps.

Re: Url.serverPath variable

I did not know this, great!

Full time Alfresco developer from Serbia

Post rating: Useful? Yes

Re: Url.serverPath variable

The url.serverPath variable gets its value from the repo.remote.url directive in repository.properties. By default it is set to http://localhost:8080/alfresco - simply replace with the correct external URL and your emailed links will go out fine. You can also override the repo.remote.url directive in tomcat/shared/classes/alfresco-global.properties for a more upgrade-friendly configuration.

Hope that helps!

Re: Url.serverPath variable

Hey guys you dont have to edit the template to change the url.serverPath, that means you will have to change all the templates for invitation emails and all the links.

Here is the best solution; there is a file you have to edit and all the others will be good
the file is called: alfresco-shared.properties and can get it in \alfresco\WEB-INF\classes\alfresco\alfresco-shared.properties

look for a line alfresco.rmi.services.external.host=localhost
edit and change localhost to the servername or server IP
save and restart the alfresco service then try to send and invitation

That has to work, any question get me here
Enjoy using alfresco
Jonathan

Re: Url.serverPath variable

mfoxtrot wrote:
In which configuration file should I change url.serverPath variable in order to receive email notifications with links that look like "http://myservername:8080/alfresco..." and not like "http://localhost:8080/alfresco..."?

Now I have to change my email notification templates with replacing this variable by exact address of my server.

----------------------------------------------------------
Here is what i did; there is a file you have to edit and all the others will be good
the file is called: alfresco-shared.properties and can get it in \alfresco\WEB-INF\classes\alfresco\alfresco-shared.properties

look for a line alfresco.rmi.services.external.host=localhost
edit and change localhost to the servername or server IP
save and restart the alfresco service then try to send and invitation

Re: Url.serverPath variable

rmi.external ???? I wouldn't change that!!! It sounds to me that what you are changing is the RMI listening port.ç

In alfresco-global.properties there are those properties:

Quote:
#
# URL Generation Parameters (The ${localname} token is replaced by the local ser
ver name)
#
alfresco.context=alfresco
alfresco.host=your.server.fullname
alfresco.port=80
alfresco.protocol=http

share.context=share
share.host=your.shareserver.fullname
share.port=80
share.protocol=http

I would give those a try.

Re: Url.serverPath variable

iblanco wrote:
rmi.external ???? I wouldn't change that!!! It sounds to me that what you are changing is the RMI listening port.ç

In alfresco-global.properties there are those properties:

Quote:
#
# URL Generation Parameters (The ${localname} token is replaced by the local ser
ver name)
#
alfresco.context=alfresco
alfresco.host=your.server.fullname
alfresco.port=80
alfresco.protocol=http

share.context=share
share.host=your.shareserver.fullname
share.port=80
share.protocol=http

I would give those a try.

That didn't work for me.

The url set in the invitation email is the same that I'm using to access the alfresco/share page, even after changing this lines and restarting Alfresco service.

Thanks in advance.

Re: Url.serverPath variable

I have tried every setting suggested in this post and restarted alfresco with each change and none of them seem to work. Running 3.4d community edition.

Re: Url.serverPath variable

ssrjazz, same problem here. I have tried all the methods above and the invitation email still sends "localhost" instead of the IP of my server.

Any idea please?

Thank you.

Re: Url.serverPath variable

Alfresco Community 4.0c

Neither of the suggestions above worked for me

sudo vi /var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/alfresco-shared.properties
#alfresco.rmi.services.external.host=localhost
alfresco.rmi.services.external.host=mydomain.com

sudo service tomcat6 restart

Didn't work

sudo vi /var/lib/tomcat6/shared/classes/alfresco-global.properties

repo.remote.url=http://mydomain.com/

sudo service tomcat6 restart

Didn't work

Any further suggestions appreciated.

Re: Url.serverPath variable

Dear friends,
Dear Community members,

any solution for this issue ?
all the porposal in this loop seem not working.

Please advise

Re: Url.serverPath variable

I have tried but it does not work

Re: Url.serverPath variable

See if this works...

Create Tomcat/shared/classes/META-INF/spring-webscripts-config-custom.xml with the following content

<alfresco-config>
 
<config evaluator="string-compare" condition="Server">
<server>
<!-- Enable and adjust the following settings to allow for proxied use of Alfresco -->
<scheme>[HTTP|HTTPS]</scheme>
<hostname>[YOUR_HOSTNAME]</hostname>
<port>[PORT]</port>
</server>
</config>
 
</alfresco-config>

Re: Url.serverPath variable

In the global properties file the following works

share.host=serverip