cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Output Pattern Behavior

kramoutar
Champ in-the-making
Champ in-the-making
Hi there,

I have a Web Form that is associated to a Template.  The output pattern for the template is ${name}.${extension} and happens to be HTML.  When I create content for the first time, all is well…I get two files in Alfresco: my-content.xml and my-content.html. 

The weird thing is, when I update this content (via the Web Form), a 3rd file gets output: my-content.html.html.  I haven't seen this behavior before.  Help!

Any assistance will be greatly appreciated.

Thanks.
7 REPLIES 7

tara_b
Champ in-the-making
Champ in-the-making
Sounds like you might be naming the content with the extension included, for example when the you open the Web Form you are naming it MyContent.html rather than just MyContent.  If you do that, your ${name} variable = MyContent.html and  your ${extension} variable = html.

kramoutar
Champ in-the-making
Champ in-the-making
No, we are not including the file extension in the file name.

However, when you update existing content the extension is part of the name, but only because it was added by Alfresco when the content was first created.

xmaniac
Champ in-the-making
Champ in-the-making

xmaniac
Champ in-the-making
Champ in-the-making
Fixed! The Jira issue contains the solution

kramoutar
Champ in-the-making
Champ in-the-making
Thanks!

pbsluvr2
Champ in-the-making
Champ in-the-making
I see from the "Jira" issue, that the issue is fixed in 3.4b but not available for download yet.

I don't know how to implement the fix in 3.4a :

To fix it replace line 235 in org.alfresco.web.forms.RenderingEngineTemplateImpl with (for example):

root.put("name", org.springframework.util.StringUtils.stripFilenameExtension(name));

Where is the file located?

pbsluvr2
Champ in-the-making
Champ in-the-making
Found this workaround for the template output:
${name?replace('.xml','')}.${extension}