Generation of static site (e.g. for burning on a CD)
cal
Joined: 2002-08-20
Posts: 6 |
![]() |
Hi all. Gallery is a wonderful system for organizing and sharing images! I've recommended it to many. One thing that I would find very useful would be the ability to make a CD of a site so that I can distribute my images to people without internet connections. I haven't seen this implemented anywhere -- can this be done in Gallery? |
|
vallimar
Joined: 2002-08-15
Posts: 487 |
![]() |
Hmm, dunno how well it would work, but if you have access to *nix |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Good suggestion, vallimar. Another thing you can do is to use the GalleryXML add on from the <!-- BBCode Start --><A HREF="http://gallery.sourceforge.net/wiki.php?page=Contributed%20Code" TARGET="_blank">Contributed Code</A><!-- BBCode End --> page. |
|
TheWatcher
![]()
Joined: 2002-08-21
Posts: 120 |
![]() |
Quote:
Hi all. Gallery is a wonderful system for organizing and sharing images! I've recommended it to many. That is a great suggestion, where you can copy a lightweight version of gallery with all selected pictures or entire sites... I will look into this, i hope my day time job will not interfere. |
|
vallimar
Joined: 2002-08-15
Posts: 487 |
![]() |
Ahhh, I totally forgot about that XML code, thanks for the reminder. |
|
cal
Joined: 2002-08-20
Posts: 6 |
![]() |
Thanks for the advice. I've downloaded the gallery2xml script and when I run it on an album called family, I get: $ ./gallery2xml -b /usr/local/gallery/albums -o gallery.xml family Before I delve into the perl, can anyone shed some light on this? Quote:
Good suggestion, vallimar. Another thing you can do is to use the GalleryXML add on from the <!-- BBCode Start --><A HREF="http://gallery.sourceforge.net/wiki.php?page=Contributed%20Code" TARGET="_blank">Contributed Code</A><!-- BBCode End --> page. |
|
skaffen
Joined: 2002-09-06
Posts: 6 |
![]() |
Great thing with burning the CD, I also want to do that and found this forum entry. Any luck so far? I'll also give it a shot later on today, my wife is an xml developer, maybe she can help. Though I'd prefer the wget option, did anyone have success with that? It'd be easier to script into an easy to use standalone script I could give to my users at work. Andreas |
|
skaffen
Joined: 2002-09-06
Posts: 6 |
![]() |
Quote:
Hmm, dunno how well it would work, but if you have access to *nix OK, my xml-attempts were not successful but before I delved too deeply into that I gave wget a shot. The following command worked AFAICT: wget -rEkmpD http://www.ikm.uni-karlsruhe.de http://www.ikm.uni-karlsruhe.de/gallery/ I never worked with wget before and I just skimmed the *huge* manpage, if anyone has more experience with wget, feel free to jump in and point out errors/optimizations. The only thing that doesn't seem to work is the slide show and login stuff, I might write a sed script some time to remove that from the html so that people don't accidentally click on it when I burn it on CD. Again any suggestions in that regard are greatly appreciated. Andreas |
|
cal
Joined: 2002-08-20
Posts: 6 |
![]() |
Thanks for the wget tip -- I had been unable to get it to work satisfactorily for me. Instead, I have been working with Norman Walsh, who contributed the gallery2xml script, and some associated files. These are in the Contributed Code section. We found some typos and small problems. I hope that we can update the previously-contributed code soon. At this point, and perhaps you or your XML-savvy spouse can help here, I have a small problem with the presence of nonstandard characters bombing the XML processor (I'm using saxon). For now, I've resorted to simply removing the offending characters, but I'm looking for a better way. In particular, I think that I need a perl module which can translate arbitrary text into saxon-compatible text. Please let me know if you're interested in helping -- I can be much more specific with the error messages and provide files which cause the problem to occur. Short answer: stay tuned. Long answer: stay tuned and I can really use a little help. Charles Quote:
. |
|
skaffen
Joined: 2002-09-06
Posts: 6 |
![]() |
Quote:
Thanks for the wget tip -- I had been unable to get it to work satisfactorily for me. |
|
vallimar
Joined: 2002-08-15
Posts: 487 |
![]() |
Glad to see people are using wget, I just threw that out there as a suggestion |
|
gomiboy
Joined: 2002-09-08
Posts: 14 |
![]() |
I'm trying to run wget on the same box that hosts gallery. Does anyone know if there's a way to point wget to the actual files, rather than a URL? I tried file:// for the URl, but got an error about unsupported protocol. I have some firewall configuration weirdness that prevents the box from accessing itself from the same URL as outside. Gallery is configured with the outside URL, so wget bombs out after fetching index.php. Thanks, |
|
vallimar
Joined: 2002-08-15
Posts: 487 |
![]() |
In a case like that, I'm not sure there is much you can do. But I'm no expert, there very well be away, I just can't think |
|
gomiboy
Joined: 2002-09-08
Posts: 14 |
![]() |
OK, I fixed the cofig problem (found the problem on the server, not the firewall) and got wget to convert gallery/index.php, but it says "nothing to do" and stops after that file. I can load the index.php.html file that it creates & it looks fine, but the pictures are links out to the webserver, not static files. I tried pointing wget at one of the albums & had the same result. I tried another plain html site (virtual hosts) on the same box & it worked fine. I'm using wget -rEkmpD etc. Anyone have any ideas why it stops? Thanks, |
|
gomiboy
Joined: 2002-09-08
Posts: 14 |
![]() |
OK, I'm an idiot. I had a robots.txt file that makes it stop. I had to point wget to http://..... gallery/index.php to make it work. Thanks for the pointer to wget. I was having a lot more trouble with the xml scripts. Chris |
|
Hurricane_GS
Joined: 2002-09-12
Posts: 1 |
![]() |
I tried it last night with a program called Teleport Pro and it worked like a champ! There is an option when creating the image that you select to "Create a browsable copy of a website on my hard drive." Then once it pulls it to the drive you can burn it to CD. Worked nice! The program is available at http://www.tenmax.com/teleport/pro/home.htm although it is not free. :???: I hope this helps! |
|
Kaballz
Joined: 2002-09-09
Posts: 4 |
![]() |
Quote:
OK, I'm an idiot. I had a robots.txt file that makes it stop. Hehe.. I hacked my wget to get rid of that robots.txt "feature". :lol: |
|
cal
Joined: 2002-08-20
Posts: 6 |
![]() |
Dear Andreas (and whoever else may be interested) -- I've been working with Norman Walsh for the last week or so trying to update the gallery2xml and associated scripts. I think we have a fully-functional method to generate a static album. The scripts can be fetched from http://nwalsh.com/hacks/gallery/index.html Here's a very-very short HOW-TO (for linux/unix users): 1. make sure that you've got the saxon XSLT processor installed and that it's called 'saxon' and is in your $path. 2. download the scripts (<!-- BBCode Start --><A HREF="http://nwalsh.com/hacks/gallery/gallery2xml" TARGET="_blank">gallery2xml</A><!-- BBCode End -->, 3. run make_static_album.csh and answer the questions. More detailed instructions (even better, follow the directions on Norman Walsh's page): 1. get the following scripts from Norman Walsh's web site: <!-- BBCode Start --><A HREF="http://nwalsh.com/hacks/gallery/gallery2xml" TARGET="_blank">gallery2xml</A><!-- BBCode End -->, 2. ensure that you have a functional XSLT processor. I've had good luck with <!-- BBCode Start --><A HREF="http://saxon.sourceforge.net/" TARGET="_blank">saxon</A><!-- BBCode End --> and <!-- BBCode Start --><A HREF="http://www.gingerall.com/charlie/ga/xml/d_sab.xml" TARGET="_blank">sablotron</A><!-- BBCode End -->. For the record, I'm using Linux Red Hat 7.1. 3. you need read-access to the files in your album and write permissions in the directory where you would like to create the static album. Make the gallery2xml script executable. This will work under unix/linux: <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>chmod 755 gallery2xml</TD></TR></TABLE><!-- BBCode End --> 4. run the gallery2xml script to generate an XML file from your album.dat file. Run it like this: <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>./gallery2xml -b /path/to/album/directory -o album.xml album_name</TD></TR></TABLE><!-- BBCode End --> 5. you can create a script to copy the image files into your target directory like this (I'm assuming you're using saxon; the sablotron syntax is a bit different): <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>saxon album.xml duptree.xsl base=/path/to/album/directory/ root=/path/to/target/directory/ > copy_files.sh</TD></TR></TABLE><!-- BBCode End --> You will need the trailing slashes on the directory paths. 6. Don't forget to create the target directory before running the script like this: <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>sh copy_files.sh</TD></TR></TABLE><!-- BBCode End -->. This should make all of the proper subdirectories and copy the images into them. 7. Create the HTML files like this (again, assuming saxon usage): <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>saxon album.xml htmltree.xsl base=/path/to/target/directory/</TD></TR></TABLE><!-- BBCode End --> 8. You will probably wish to copy your $GALLERY_HOME/images directory into your target directory for the little GIF files like arrows, etc. Of course, $GALLERY_HOME may be /usr/local/gallery or some other location, depending on your Gallery setup. Also, you may wish to copy a stylesheet from $GALLERY_HOME/css into a file called album.css in your target directory. Finally, I like the idea of creating a main index.html file which redirects you to the album's index.html. |
|
gomiboy
Joined: 2002-09-08
Posts: 14 |
![]() |
Teleport doesn't work with URL's that specify a port nuber (ie http://www.foobar.com:8000/). :cry: |
|
gomiboy
Joined: 2002-09-08
Posts: 14 |
![]() |
I used wget on a redhat box to generate a static page. Then I zip it up, transfer it all over to my windows PC, unzip, burn it on a CD, and view with Mozilla 1.2a. The first page of every album works fine, but the links to the later pages look something like: It looks like unix zip or windows winzip 8.0 is munging the file names. If anyone else if having this problem I wrote a sed script that changes the html code to match the file names. #! /bin/sh |
|