From 666381853b0b00928b292fdc61b4e882dcf2d31b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl>
Date: Tue, 12 Dec 2006 16:55:15 +0000
Subject: [PATCH] html representation packed into an iframe (because trimmed
 html left unclosed tags, sometimes breaking page layout)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11702 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../html_representation.xml                   |  2 +-
 .../erp5_dms/document_preview_iframe.xml      | 82 +++++++++++++++++
 .../erp5_dms/document_preview_page.xml        | 87 +++++++++++++++++++
 bt5/erp5_dms/bt/revision                      |  2 +-
 4 files changed, 171 insertions(+), 2 deletions(-)
 create mode 100644 bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_iframe.xml
 create mode 100644 bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_page.xml

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
index d66749a103..af67b507a0 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
@@ -299,7 +299,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>here/DMS_decorateHtmlRepresentation</string> </value>
+            <value> <string>here/document_preview_iframe</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_iframe.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_iframe.xml
new file mode 100644
index 0000000000..a51d9ee6e8
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_iframe.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PageTemplates.ZopePageTemplate</string>
+          <string>ZopePageTemplate</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<iframe id="document_preview" class="document_preview" tal:attributes="src python:here.absolute_url()+\'/document_preview_page\'">\n
+</iframe>\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>document_preview_iframe</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_page.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_page.xml
new file mode 100644
index 0000000000..32c4ce38bd
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/document_preview_page.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PageTemplates.ZopePageTemplate</string>
+          <string>ZopePageTemplate</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<html>\n
+  <body>\n
+\n
+<span tal:replace="structure here/DMS_decorateHtmlRepresentation"/>    \n
+\n
+  </body>\n
+</html>\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>document_preview_page</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 43f9cb6413..5f7b1b0513 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-396
\ No newline at end of file
+399
\ No newline at end of file
-- 
2.30.9