cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco share html file content issue

aaditvmajmudar
Confirmed Champ
Confirmed Champ
Hello All,

We are facing one issue while donwloading html file from alfresco share.

The html file is having different tags including "iframe" tags.

When we download file from alfresco explorer and open, it looks perfectly fine but when I download that file from Alfresco share, "iframe" tags are not there in file content.

Alfresco Version : 3.4.14 enterprise

Please suggest.
7 REPLIES 7

romschn
Star Collaborator
Star Collaborator
This blog may be helpful to you and can give pointers to you for fixing this.
http://blogs.alfresco.com/wp/kevinr/2012/06/19/configuring-the-share-html-processing-blackwhite-list...

aaditvmajmudar
Confirmed Champ
Confirmed Champ
Thank you romschn.!

But it's not working in alfresco 3.4.14.

It seems that, this will work in alfresco >=4.1 .

darthnater
Champ in-the-making
Champ in-the-making
I am also having the same issue. We are using 4.2 I tried doing what they said in the post but it didn't work.
This is the custom-slingshot-application-context.xml they talk about in the blogpost.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans-2.0.dtd'>

<beans>
   <bean id="webframework.webscripts.stringutils" parent="webframework.webscripts.stringutils.abstract"
         class="org.springframework.extensions.webscripts.ui.common.StringUtils">
      <property name="tagWhiteList">
         <set merge="true">
       <value>SCRIPT</value>
       <value>STYLE</value>
       <value>!DOCTYPE</value>
            <value>HTML</value>
            <value>HEAD</value>
            <value>BODY</value>
            <value>META</value>
            <value>BASE</value>
            <value>TITLE</value>
            <value>LINK</value>
            <value>CENTER</value>
            <value>EM</value>
            <value>STRONG</value>
            <value>SUP</value>
            <value>SUB</value>
            <value>P</value>
            <value>B</value>
            <value>I</value>
            <value>U</value>
            <value>BR</value>
            <value>UL</value>
            <value>OL</value>
            <value>LI</value>
            <value>H1</value>
            <value>H2</value>
            <value>H3</value>
            <value>H4</value>
            <value>H5</value>
            <value>H6</value>
            <value>SPAN</value>
            <value>DIV</value>
            <value>A</value>
            <value>IMG</value>
            <value>FONT</value>
            <value>TABLE</value>
            <value>THEAD</value>
            <value>TBODY</value>
            <value>TR</value>
            <value>TH</value>
            <value>TD</value>
            <value>HR</value>
            <value>DT</value>
            <value>DL</value>
            <value>DT</value>
            <value>PRE</value>
            <value>BLOCKQUOTE</value>
            <value>BUTTON</value>
            <value>CODE</value>
            <value>FORM</value>
            <value>OPTION</value>
            <value>SELECT</value>
            <value>TEXTAREA</value>
         </set>
      </property>
   <property name="attributeBlackList">
         <set></set>
      </property>
   </bean>

</beans>

aaditvmajmudar
Confirmed Champ
Confirmed Champ
Hi Darth,

Keep black list property set blank and add tags which you want to remain as it as while downloading the file, add those tags in tagWhiteList property set.

e.g. <value>IFRAME</value>

This will solve the problem.

Hope this helps.

darthnater
Champ in-the-making
Champ in-the-making
Thanks for the quick reply
I added the following

            <value>INPUT</value>
            <value>FIELDSET</value>
            <value>LABEL</value>
            <value>SCRIPT</value>


It is still pulling the style, fieldset, and input tags though.

aaditvmajmudar
Confirmed Champ
Confirmed Champ
Hi Darth,

I have added iframe tag in my white list and while downloading file from alfresco share, its working fine.

Can you post the whole bean definition here?

Thanks & Regards,
Aadit Majmudar

garbetsp
Champ on-the-rise
Champ on-the-rise

I just got this to work in 5.1.g. 

Had to create a file

/opt/alfresco-5.1.g/tomcat/shared/classes/alfresco/web-extension/custom-slingshot-application-context.xml

That contained the following:

<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:hz="http://www.hazelcast.com/schema/spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
         http://www.hazelcast.com/schema/spring
         http://www.hazelcast.com/schema/spring/hazelcast-spring-2.4.xsd">

<bean id='webframework.webscripts.stringutils'
parent='webframework.webscripts.stringutils.abstract'
class='org.springframework.extensions.webscripts.ui.common.StringUtils'>
<property name='attributeBlackList'>

<set></set>

</property>

<property name='tagWhiteList'>
<set>
<value>!DOCTYPE</value>
<value>HTML</value>
<value>HEAD</value>
<value>BODY</value>
<value>META</value>
<value>BASE</value>
<value>TITLE</value>
<value>LINK</value>
<value>CENTER</value>
<value>EM</value>
<value>STRONG</value>
<value>SUP</value>
<value>SUB</value>
<value>P</value>
<value>B</value>
<value>I</value>
<value>U</value>
<value>BR</value>
<value>UL</value>
<value>OL</value>
<value>LI</value>
<value>H1</value>
<value>H2</value>
<value>H3</value>
<value>H4</value>
<value>H5</value>
<value>H6</value>

<value>H6</value>
<value>SPAN</value>
<value>DIV</value>
<value>A</value>
<value>IMG</value>
<value>FONT</value>
<value>TABLE</value>
<value>THEAD</value>
<value>TBODY</value>
<value>TR</value>
<value>TH</value>
<value>TD</value>
<value>HR</value>
<value>DT</value>
<value>DL</value>
<value>DT</value>
<value>PRE</value>
<value>BLOCKQUOTE</value>
<value>BUTTON</value>
<value>CODE</value>
<value>FORM</value>
<value>OPTION</value>
<value>SELECT</value>
<value>TEXTAREA</value>
<value>SCRIPT</value>
<value>STYLE</value>
</set>
</property>

<property name='attributeGreyList'>
<set></set>
</property>

</bean>


</beans>