OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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
coop
 
Posts: 7
Joined: Mon Mar 03, 2008 1:59 pm

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
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

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.
coop
 
Posts: 7
Joined: Mon Mar 03, 2008 1:59 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests