Import HTML directly [RESOLVED]

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
coop
Posts: 7
Joined: Mon Mar 03, 2008 1:59 pm

Import HTML directly [RESOLVED]

Postby coop » Mon Mar 03, 2008 2:17 pm

So we have all of the HTML that we want to import already in a database. Rather than reading the entire page in, which contains items we dont want, I just want to directly load the content.

So instead of:

<htmlgalley>
<label>HTML</label>
<file><href mime_type="text/html"
src="http://www.mysite.com/V1i1a1.html" /></file>
</htmlgalley>

I would like to do something more like this:

<htmlgalley>
<label>HTML</label>
<file><href mime_type="text/html" src="<html><head><title>My Title</title></head><body><p>text here</p></body></html>"/></file>
</htmlgalley>

Is this possible, I've been trying to do this and I get the error: This plugin does not support the supplied root node ""

Thanks. Coop

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: Import HTML directly

Postby jmacgreg » Mon Mar 03, 2008 5:04 pm

Hi coop,

Take a look at the following post:

viewtopic.php?f=8&t=2550&p=8932

The upshot being, if you want to use the <embed> tag, you'll have to base64-encode your HTML files. There are other threads in this forum regarding base64 encoding, and file importing in general -- search for base64 and you should find more information on the subject.

Cheers,
James

coop
Posts: 7
Joined: Mon Mar 03, 2008 1:59 pm

Re: Import HTML directly

Postby coop » Tue Mar 04, 2008 7:37 am

Ok, so I tried that and changed the galley file section to look like this:

<galley>
<label>html</label>
<file>
<embed encoding="base64" filename="abeLinc.html" mime_type="text/htm">PGh0bWw+PGhlYWQ+PHRpdGxlPkVuY3ljbG9wZWRpYSBvZiBDbGV2ZWxhbmQgSGlzdG9yeTpBQlJBSEFNIExJTkNPTE4nUyBGVU5FUkFMPC90aXRsZT48L2hlYWQ+PGJvZHk+PHA+dGV4dCBoZXJlPC9wPjwvYm9keT48L2h0bWw+</embed>
</file>
</galley>

It successfully imported the file, but now when I go to browse the uploaded html, instead of rendering the HTML, it prompts me to download the html file. Any ideas?

Thanks.

coop
Posts: 7
Joined: Mon Mar 03, 2008 1:59 pm

Re: Import HTML directly

Postby coop » Tue Mar 04, 2008 7:41 am

Never mind, I changed the galley to htmlgalley and now it works fine.

<htmlgalley>
<label>html</label>
<file>
<embed encoding="base64" filename="abeLinc.html" mime_type="text/htm">PGh0bWw+PGhlYWQ+PHRpdGxlPkVuY3ljbG9wZWRpYSBvZiBDbGV2ZWxhbmQgSGlzdG9yeTpBQlJBSEFNIExJTkNPTE4nUyBGVU5FUkFMPC90aXRsZT48L2hlYWQ+PGJvZHk+PHA+dGV4dCBoZXJlPC9wPjwvYm9keT48L2h0bWw+</embed>
</file>
</htmlgalley>

Thanks for the help.


Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests