cancel
Showing results for 
Search instead for 
Did you mean: 

Url.serverPath variable

mfoxtrot
Champ in-the-making
Champ in-the-making
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.
24 REPLIES 24

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
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.

invictus9
Champ in-the-making
Champ in-the-making
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?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
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.

tctim
Champ in-the-making
Champ in-the-making
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

tctim
Champ in-the-making
Champ in-the-making
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

dangruhn
Champ in-the-making
Champ in-the-making
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?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
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.

dangruhn
Champ in-the-making
Champ in-the-making
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.

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
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.