Forum OpenACS Q&A: Re: Troubles exporting static-portlet to xowiki

Collapse
Posted by Gustaf Neumann on
The script runs in ds/shell and in your export script in a different tcl namespace. Add e.g. "ns_log notice ns=[namespace current]" to your commands...

When a new object is created, the name might be absolute (with leading ::) or relative to the current namespace of tcl. To get your expected result, use an absolute name and do ::xowiki::Page create ::$content_id ...

Clear?

Collapse
Posted by Nima Mazloumi on
Yes. Thanks. It works now. For some reason when importing the file the content is not displayed correctly though it was imported fully. Any idea?

Is this an encoding problem?

::xowiki::Page create ::48901 -noinit \
	-set creator {} \
	-set page_order {} \
	-set lang en \
	-set creation_user 27685 \
	-set render_adp 1 \
-set text {<ol>
<li>FAQs
<ul>
<li>Für <a href="#/a/admin-faq">Admins</a>
<li>Für <a href="#/a/user-faq">Users</a> allgemein
<li><a href="#/help">Help</a>
</ul>
<li><a href="#/dotlrn/help">Hilfe</a>
<li><a href="#/support">Support Service</a>
<li><a href="#/shared/community-member?user_id=27685">Systemadministrator</a>
</ol>} \
	-set absolute_links 0 \
	-set package_id 1456 \
	-set folder_id -100 \
	-set nls_language en_US \
	-set name portlet-48901 \
	-set mime_type text/html \
	-set publish_status ready \
	-set title Hilfe \
	-set revision_id 0 \
	-set modifying_user 27685 \
	-set parent_id -100 

::xowiki::Page create ::48865 -noinit \
	-set creator {} \
	-set page_order {} \
	-set lang en \
	-set creation_user 27685 \
	-set render_adp 1 \
	-set text {

 Hallo - Willkommen..

} \ -set absolute_links 0 \ -set package_id 1456 \ -set folder_id -100 \ -set nls_language en_US \ -set name portlet-48865 \ -set mime_type text/html \ -set publish_status ready \ -set title {e-Learning Gruppe} \ -set revision_id 0 \ -set modifying_user 27685 \ -set parent_id -100
Collapse
Posted by Gustaf Neumann on
For content items of mime_type text/html, the convention in
OpenACS is to store in the contents of the attribute "text" 
the detailed mime-type as well. So instead of "hello world",
use "{{hello world" text/html}" 
Technically the contents are a tcl list with two elements. 

On import/export of xowiki, this field is not interpreted. 
So change your generation script to:

::xowiki::Page create ::48865 -noinit \
  ...
  -set text {{
 Hallo - Willkommen..
} text/html} \
  ...