create new tag
, view all tags

Archive of PublishContribDev

Eric, this is terrific! Well done! I've wanted to see this plugin "done properly" for a long while now, but I just haven't had time.

-- CrawfordCurrie - 08 Jan 2003

Thanks for the feedback. I'm using it in a volunteer effort to build a public web site for a non-profit group I care about (see http://www.mn-leon.org). I'm very excited about the way TWiki (with a bunch of extensions I've been developing) are working for this site.

-- EricScouten - 09 Jan 2003

Eric, thank you for this plugin. I'm using it from the command line to automatically generate static HTML from my TWiki webs. I had some problems with the links: an absolute <base> tag was being inserted on every document, plus many of the links still pointed to /bin/view/... or http://localhost/bin/view/... in the output. I only recently started using TWiki, so I may be doing something wrong. In the meantime, I made some small changes to bin/publish to fix those, and to fix a logic error in the test for creating the web-specific directory. See the attached file publish.fixlinks.patch.

Thank you for any comments or suggestions!

-- DiegoZamboni - 17 Jan 2003

Nice! Hey, I suspect that it wouldn't take much to use this to cache the HTML version of topics. That could get sent if the cached version is newer than the topic text and there are no dynamic elements to the page. Furthermore, this could be refreshed on a periodic basis.

-- MartinCleaver - 18 Jan 2003

I must say that EricScoutens linked site is one great example of the many diverse possible uses for TWiki there are. Nice work! smile
I have a question concerning this line:

# Root URL for static-published HTML (should point to $publishDir) [scouten 12/08/02]
$publishUrlPath     = "/url/path/to/published/files/";
Is there any reason (that I can't seem to think of) why this value can't be specified from the "Publish" form? And, is it optional (I have no possibility of testing it out ATM) - are the links made relative, as opposed to relative-to-root or absolute?

-- ConnyBrunnkvist - 20 Jan 2003

The description of the plugin says that all links are made relative. However, in my tests, many of them came out as abolute links to URLs in localhost, and some of them as relative-to-root with /bin/view/... on them. I didn't really delve into the details of the problem, but I made a patch (see attached file) to make all links relative right before printing the HTML documents out. It works for me, but maybe there are some cases where it messes things up.

-- DiegoZamboni - 21 Jan 2003

Hello Eric,

thank you for this wonderfull Addon. I have a difficulty to make it run on Windows XP.

My error message in the Browser is:
Insecure dependency in open while running with -T switch at c:\TWIKI_~4\bin\publish line 407.

What is wrong here?
My TWiki.cfg :
# Root directory for static-published HTML
$publishDir = "c:/twiki_athens/published/";
# Root URL for static-published HTML (should point to $publishDir)
$publishUrlPath = "/twiki_athens/published/";

-- MartinRaabe - 21 Jan 2003

I'm getting the same on my HP-UX box. Apparently, the taint checks are enabled, and so Perl will reject assignments such as the one for $htmlPath in the publish script. I'm sure somebody out there already has found the "correct" regex for untainting the publishing path...

-- ClausBrod - 31 August 2004

I made some further changes to the pulish script. Attachments and such are now put in rsrc instead of .rsrc so that it doesn't get excluded during copies. Also, I was getting links to file:///twiki/pub/.rsrc for my attachemts so I fixed them to point to a relative URL. I've attached my version (which incorporates DiegoZamboni's patch) of the script to this topic.

-- DanBoitnott - 29 Jan 2003

This is a superb addon - outstanding! I particularly like the way it incorporates existing plugins. Thanks Eric wink

My tip: Since the Web.* pages are not published by default, create a new page called "Index" (yes, ok, it is not a WikiWord) which will then be automatically published as Index.html and become the default homepage for your static site.

-- RossC - 13 Feb 2003

i think there is an error in current publish script line 264: web subdirectory is created only if $noWebDir is set.

-- AlexanderSmishlajev - 18 Mar 2003

Great AddOn! -I've added a patch that fixes an issue with the subsitution of links, to correctly include the base path (published location of scriptdir + "/view" (ie: /twiki/bin/view) instead of the hardcoded "/bin/view") in substituion searches. Also, what about those "view"-script-suffixes? I ran across them in parts of twiki sources, but can't locate 'em right now anymore. One more thing: my fix also adds case insensitivity to the replacement search, to catch "HREF"s as well as "href"s.

-- JuergenPabel - 1 Apr 2003

This looks good, any chance that it can incorporate the functionality from GetAWebAddOn?

-- MartinCleaver - 21 Apr 2003


I have been trying to install the PublishAddOn. But not work %ATTACHURL%/exemple.pdf link.



-- VaidotasBarzdenas - 08 Oct 2003

I have addapted PublishAddOn to create a ZIP file. This is better as we can publish directly in publish dir, zip is easier to send per mail, it's easy to remove old zips, there is no conflict between published topics in the same web, etc...

ZIP is base on PERL ZIP lib so it does not need any external tool (Perl Zlib.pm and Perl Archive Zip)

All pub needed components are copied, not only those of current web. This is needed for some skins and plugins which use images from common webs like TWiki web for example. This new release works also well with complex plugins like TwikiDraw, LdapPlugin (with photos wink ) and also with SlideShowPlugin !), etc....

Note that getEmailNotifyList is from MailNotificationEnhanced but the origninal one can still be used. I would just suggest to create a MailNotifyPublish topic rather than the MailNotify which is reserved changed topics notification rather than published topics.

I have build a tgz with old/new files and diff too : publish_in_zip.tgz

Hope you will enjoy these enhancements ! I think that this could be add to future TWiki releases, this is why I have changed oopsmore.tmpl to get current topic (or more) in a zip, and just send it per mail for example or store it somewhere as statis HTML doc ... generated by TWiki ;-).

Version 1.2 available is able to publish a TWiki Slide Show , in Presentation mode ! I hope peter will be happy to know that we are also able to publish a TWiki Slide Show wink

-- PatrickNomblot - 19 Nov 2003

I am having some trouble getting the publish script to work.

I have changed the TWiki.pm script as the main page describes, and have changed the TWiki.cfg file as so:

# Root directory for static-published HTML [scouten 12/08/02] $publishDir = "/var/http/theoretic/"; # Root URL for static-published HTML (should point to $publishDir) [scouten 12/$ $publishUrlPath = "./";

I am trying to get the publish script to publish to the root directory of my domain name, the DocumentRoot of Apache. That Way I can get a ShorterURL effect without expensive Apache URL Rewrite overhead.

However, I am getting the following error When running the publish script from the web with goAhead and debug enabled:

Content-type: text/plain

DOCUMENT_ROOT => /var/http/theoretic
HTTP_ACCEPT_ENCODING => gzip, deflate
HTTP_HOST => new.theoretic.com
HTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)
MOD_PERL => mod_perl/1.99_09
PATH => /bin:/usr/bin
PATH_INFO => /Ransom/Home
PATH_TRANSLATED => /var/http/theoretic/Ransom/Home
QUERY_STRING => goAhead=yes&debug=yes
REQUEST_URI => /bin/publish/Ransom/Home?goAhead=yes&debug=yes
SCRIPT_FILENAME => /var/http/theoretic/bin/publish
SCRIPT_NAME => /bin/publish
SERVER_ADMIN => root@theoretic.com
SERVER_NAME => new.theoretic.com
SERVER_SIGNATURE => <address>Apache/2.0.47 (Gentoo/Linux) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.47 OpenSSL/0.9.6k PHP/4.3.3 Server at <a href="mailto:root@theoretic.com">new.theoretic.com</a> Port 80</address>

SERVER_SOFTWARE => Apache/2.0.47 (Gentoo/Linux) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.47 OpenSSL/0.9.6k PHP/4.3.3
mkdir /var/http/theoretic/publish/
mkdir /var/http/theoretic/publish//web

publishTopic(Ransom, Changes, sunflower, ...) .
  Read template.
  Read topic.
  Check page permissions.
  Handle standard formatting (text).
  Handle standard formatting (topic).
  Handle standard formatting (meta).
  Merge content.
  Copy files .
  Update internal links .
  Scrap <nopublish> .
  Insert .html in internal links .
  Write HTML .
<h1>Software error:</h1>
<pre>Insecure dependency in open while running setgid at /var/http/theoretic/bin/publish line 414.
For help, please send mail to the webmaster (<a href="mailto:root@theoretic.com">root@theoretic.com</a>), giving this error message 
and the time and date of the error.


The topics are not published to the directory. Thanks.

-- AdamTheo - 07 Dec 2003

There are 3 differents publish version here ... which one do you use ? I would suggest you to use the publish in ZIP so I could help you wink .

-- PatrickNomblot - 09 Dec 2003

Patrick is right.. It is very confusing as to which is the latest and best version to use. I downloaded the plugin from StylePlugin page. As reported above, this version has bugs (base tag means external links are maintained). I have downloaded an updated version from this page which contains a file called publish.orig However this is not the same as the origional file I downloaded.

Please could someone help by identifying the most effective version.

Patrick, does your version only publish to zip, or does it give this as an option? I would like to publish to a static html directory. However, the zip functionality would be very usefull for backups.

EDIT... I have just tried using publish-zip. I get the error " can't locate Archive/Zip.pm in @INC " Do I need some external tools after all? You need the Archive::Zip perl module http://search.cpan.org/dist/Archive-Zip/. if you're root then perl -MCPAN -e shell and install Archive::Zip should do it.

Many thanks

-- TomDowden - 16 Jan 2004

And access control

Works a treat with access control off smile but with access control on, all the topics read "No permission to read topic TopicName." This is with the publish script listed in .htaccess as requiring a valid user.

I'll try to fix this but, in the meantime, the workaround is to make the web public before publishing. Anyone got a fix up their sleeve?

-- SteveBaker - 20 Jan 2004

Here's a crontab entry that seems to work for nightly runs of Patrick's version of the plugin:

0 0 * * *       /usr/bin/wget -O /home/tcabot/public_html/wiki-mirror.html  'http://wikiHostName/wiki/bin/publish/Main/WebHome?exclusions=&goAhead=yes'

Note that this will mail wget's output to you by default, if you don't want that then redirect stdout and stderr to /dev/null. It saves the output page so people know where to pick up the zip file.

Question: would it be better if the script actually returned the zip file (with the appropriate MIME-type) instead of saving it somewhere and returning a page that points to it? The script would then work with zero changes to TWiki.cfg and TWiki.pm, and it would work for multiple people trying to use it at the same time.

-- TobyCabot - 10 Feb 2004

I've updated the modifications that must be done to the TWiki.pm script to include the new POD documentation tags that are being done in the alpha versions lately.

# =========================

---++ sub getPublishDir ()

Finds the full system path directory that the Plugins.PublishAddOn
publishes static HTML versions of the TWiki to.


sub getPublishDir
    return $publishDir;


# =========================

---++ sub getPublishUrlPath ()

Finds the base URL path directory that the Plugins.PublishAddOn
publishes static HTML versions of the TWiki to.


sub getPublishUrlPath
    return $publishUrlPath;

# =========================

By the way, for those wondering, I've just been using the new-publish.tgz version of this AddOn. It's been working fine for me on the latest beta and now alpha. I tried the ZIP version once, but had trouble installing it and getting it to publish simply static HTML instead of ZIP packages.

-- AdamTheo - 10 Apr 2004

Just to let everyone know, the add-on contained in the "new-publish.zip" package here is no longer working with the latest alpha releases of TWiki. I'm getting the following error:

Undefined subroutine &TWiki::getRenderedVersion called at /var/www/theoretic/bin/publish line 295.

-- AdamTheo - 29 Apr 2004

Replace call to TWiki::getRenderedVersion() with TWiki::Func::renderText().

-- PeterThoeny - 07 May 2004

It would be great if we had a PublishAddOn out-of-the-box version for Cairo. Also as added marketing value for TWiki.

-- ArthurClemens - 15 Aug 2004

The PublishAddOn topic has a version 1.1. And here I find 4 attachments. Several seems to be full packages. One of you talks about a version 1.2. Which one would that be? Why hasn't that 1.2 been uploaded to PublishAddOn? I have not got a clue to what to install and whether any of them work on Cairo?

-- KennethLavrsen - 08 Oct 2004

I tested both 1.1 and the latest here on the Cairo release. They both failed. I tried to start fixing bugs but then the next bug came out. Always missing functions. Unless you have an old version of TWiki and you can program Perl - don't waste your time on trying this plugin.

-- KennethLavrsen - 08 Oct 2004

I felt sorry for this plugin, so I repackaged it under the BuildContrib and fixed the major screwups. However - and it's a big however - I have done no testing whatsoever. That's up to you as users. It ought to run now, and I'll fix any of the obvious bugs you find, as long as they are easy to fix, and as long as I have time.

Oh, I changed it to get the publish dir and url from the plugin page, so no change to TWiki.pm is required to install.

-- CrawfordCurrie - 13 Oct 2004

Couldn't this be made to use CPAN:Archive::Zip only optionally resp. configurable? It installs without warning that Archive::Zip is missing!

-- FranzJosefSilli - 14 Oct 2004

OK, I'll add in the dependency. Someone else can make the zip step optional.

-- CrawfordCurrie - 14 Oct 2004

Thanks Crawford for your work here... I think its real close smile

I can run and get a zip file of any single page, but it never seems to chase links/recurse the web (which is it supposed to do?)...

Anybody have ideas? I'm digging through it, but thought I would post and make sure I wasn't just missing the obvious.

-- BruceDillahunty - 20 Oct 2004

I am using the version dated Oct 13th on the main Addon page. I have the same issues as BruceDillahunty and FranzJosefSilli. This is completely broken on Cairo. Documentation is sorely lacking. For some reason, it refused to acknowledge that the 2 required preferences were in TWikiPreferences (this is one of the big holes in the install notes, actually telling you what you need to do to install and configure it) even though placing the variables in e.g. WebHome returned the path properly (perhaps because I use SpeedyCGI?), then suddenly it began working. However it only published WebHome, and in a ZIP file. So, still not at all useful. Temporarily disabling SpeedyCGI didn't change that.

There are no Unix execute permissions on bin/publish. The PublishAddOn_installer.pl did not help that in any way.

Just a suggestion, perhaps in the future it would be a good idea not to put up code on the main Addon page with "no testing whatsoever" and then label it as "Cairo Compatible". It should have been attached here as "for testing with Cairo". I don't mind testing and helping to fix bugs, but I'd like to know what I'm getting into beforehand. I had been happily using GenHTMLAddon up until I upgraded to Cairo in October, so I have never used PublishAddOn before. I suppose I'll go see if that works with Cairo...

-- BillSmargiassi - 02 Nov 2004

If it helps anybody any, I have figured out (I think) that it seems to "not work" due to the inclusions/exclusions stuff... I haven't found exactly what the deal is, but it will return the one page I give it. If you comment out lines 296-297 in Publish.pm

         next unless grep { /^$topic/ } @include;
         next if grep { /^$topic/ } @exclude;

Then it at least tries to run... of course then I've had other issues with not handling a page in my web and I haven't gotten back to it.

-- BruceDillahunty - 02 Nov 2004

Is anyone successfully using PublishAddOn?

-- StevenLumos - 04 Nov 2004

Well, getting closer, anyhow smile

The bug with not processing multiple items seems to be related to the "include" stuff, not the exclude. If you comment out line 296 in Publish.pm

         next unless grep { /^$topic/ } @include;

Then it processes.

After that, I've found two bugs so far... both kind of obscure.

  1. If you have a topic with multiple question marks (i.e. is this going to fail???) then the publish dies there
  2. If you have a formatted search using a $pattern() and the text that is returned ends with an item in parens (such as this) then it fails there... if the parens are before the end, then it works

-- BruceDillahunty - 04 Nov 2004

Bruce, did you get it going, yet?

-- FranzJosefSilli - 09 Nov 2004

Well, since you prodded me on to it, I worked on this again for a bit. I think I have it going now, but haven't done much testing. I have attached a new Publish.pm file (below) that you need to use to replace the one in the package... Until some more testing and trials go into this, I wasn't comfortable just replacing things.

Fixes included a couple of items:

  1. I put some code from the older version back in to handle the "include/exclude" list... the new "grep" based code just didn't seem to work. Note that I am not a perl person, so it may be that it could be easy to fix, but I couldn't figure out the problem, but the old version worked, so I put it back smile
  2. I added some more link re-writing stuff to handle the (new?) class="twikiLink" aspect of the links

Changes that I made have comments tagged "BCD" if anybody is curious. Note that the form is a bit confusing to me... the first field of "topic included from name" works... I don't know that the second field of "topic included from content" works.

Hope this helps.

-- BruceDillahunty - 11 Nov 2004

One small thing should be added to the "Install Instructions" section:

* Install Archive::Zip from CPAN if you don't already have it

or whatever is appropriate.

-- ScottBeverly - 09 Dec 2004

So. I patched the publish.pm file to make the multiple includes work according to BruceDillahunty. i set $debug =1; to force the debug output

START PUBLISHING... TOPICS : AboutSEEGrid TOPICS : AdamBoey .... (heaps - like 200 or so) TOPICS : YoungKwangYeon TOPICS : YutakaMurakami ZIP CREATED : /home/httpd/twiki/published/TWikiGuest_Main_07_Jan_2005.zip

then in the zipfile there is nothing? what has gone wrong? I can get it to return the current page only in the zip file. but on multi page select i get nothing....

-- TerryRankine - 07 Jan 2005

I also did some changes to the (13 Oct 2004 - 16:17) version:

  • Added a debug checkbox to publish.tmpl
  • Added 3 option list to publish.tmpl
    • Write output to zip-file (default)
    • Write output to publishDir
    • Write output to new subdirectory with the same name as the zip-file, below publishDir Implementation is very dirty, zip->unzip to new directory due to lack of perl knowledge
  • Fixed inclusions/exclusions handling to reflect the behaviour described in the documentation, i.e. inclusions and exclusions are regexp, inclusions override exclusions, if no Topic is given and the exclusions are left alone (Web.*) everything but Web.* gets written to the zip-file.

Not thoroughly tested yet, but hopefully you find my mistakes and maybe someone can fix the things I couldn't.

-- MariusReiner - 07 Jan 2005

Just fixed a bug in Publish.pm, where some resources weren't copied because the corresponding link didn't point to http://localhost/something but http://hostname/something Files are updated in PublishAddOn-FixInclusions.zip

-- MariusReiner - 11 Jan 2005

I wish that docs were clearer. Even here this is all hard to follow somewhat. I just spent another two hours or more trying these patches and recomendations with no result.

All I get now is:Undefined subroutine &TWiki::getPublishDir called at publish line 128

Does this work??? IF it does, will somebody someplace write instructions??? It is tiring to chase down docs all over. Where does it say to alter twiki.cfg? and what to do...I did that myself added: $publishDir = "/home/bkdesign.ca/html/twiki"; $publishUrlPath = "http://www.bkdesign.ca/twiki";

I have no way of knowing if this is correct. Why don't you get a forum like Movable Type has. At least there one can get help in a more organized fashion. I like twiki a lot, and am spending an enormous amount of time reconfiguring it at my site...hopefully to make it a lot more popular, but please stop posting addons that either don't work or are totally unclear as how to configure. That is a major detraction with twiki. Everyone out here isn't a programmer.

-- BruceRProchnau - 16 Jan 2005

umm- i didnt alter twiki.cfg - i put it in TwikiPreferences cos i wanted it site wide. I use apache/mod_auth_mysql access rights to control user using it. but those variables are ment for either TwikiPreferences or WebPreferences

-- TerryRankine - 28 Jan 2005

In version 1.3 of my patch files in the destination directory are overwritten without asking, please remove the -o parameter in the unzip command in Publish.pm, if you don't want this behavior. Also there is a fix of TerryRankine so there are no debug messages printed anymore when debug=0.

-- MariusReiner - 30 Jan 2005

We run twiki on a https server. however the scripts is deigned only for http, can we post some ghanges to provide https and http support.

this is a perl regexp

$tmpl=~s((?<==\")(?:http://$httphostname)?$PubUrlPath\/([^\"]+)(?=\")) (&copyResource($web, $1, $copied, $zip))geo;

can we make it match https as well?


?=0 or 1 in perl i think and [] is a include.

-- TerryRankine - 31 Jan 2005

When I have anchor links to (non-local) topics, the link in not working. Did anyone have a tip on this? I guess there something to do with the getInternalLinkTemplate sub: it is passing an undef as the anchor, but I do not know enough perl to fix it... frown

-- DanielSalles - 02 Feb 2005

BradTaylor added Archive::Zip and Compress::Zlib to the dependency list. This doc should be taken into the next release.

-- PeterThoeny - 04 Feb 2005

Some problems during installation. PublishAddOn_installer.pl tell me:

Please edit the topic in TWiki and Save without changing it to update the history.
I tried to do it but it works just the same. I hope that this PublishAddOn_installer.pl is not useful unless some perl module is missing or something like that...

-- LucaVenturini - 08 Feb 2005

You can ignore that warning, it shouldn't matter.

-- CrawfordCurrie - 01 Mar 2005

Hmmm, I just downloaded the PublishAddOn.zip file from the PublishAddOn topic at Twiki.org and the publish script dies with:

Premature end of script headers: publish

This looks to be a newer version of the add on than the links below, as it was packaged on Feb 8, 2005.

Anyone know what's happening?

-- SteveWampler - 08 Mar 2005

The execute permissions for the publish script and the destiny publish directory are ok?

-- DanielSalles - 09 Mar 2005

The plugin works fine with TWiki version: 30 Oct 2004 $Rev: 1794 $, but only for a single topic. I'll appreciate any clue to be able to publish a web taken as a whole ?

-- BenoitFauvel - 22 Mar 2005

BUG REPORT: variables such as % REVINFO %, %REVISIONS% aren't converted correctly. Look at the differeneces at end of these pages:

-- NguyenDinhNam - 27 Mar 2005

That limitation is actually documented as a known problem on the PublishAddOn page ......

-- CrawfordCurrie - 31 Mar 2005

I've been working with someone who is trying to use this plugin, and it has revealed a number of issues:

  • The documentation is awful. I couldn't work out how to drive it, at first.
  • I had to rewrite the interface before it was even marginally useful (I needed REs, not just lists of topics)
  • It is very slow; it kills the server to publish a big web.
  • You can only publish to Zip, they have removed the old GenHTML directory option.
  • It requires Archive::Zip and Compress:Zlib. Another argument for a "publish to directory" options.
  • The way it chooses the publish dir is a huge security hole. I could set PUBLISH_DIR to just about anything!
  • It does not honour access controls.

So, I'm going to address some of these issues, and maybe a few other mentioned above, and re-release it. Watch this space.

-- CrawfordCurrie - 05 Apr 2005

PublishAddOnOnlyOneTopicPublished has a bug report for this add-on.

-- PeterThoeny - 06 Apr 2005

I am just about to re-release this AddOn. I have made some significant changes, so make sure you read the front page again. Most important is the fact that the format of the control topic has changed, as have the parameters to the script. Anyway, read the front page, you'll see what I mean. Feedback is very welcome.

-- CrawfordCurrie - 11 Apr 2005

YEAH!!! It works!!!

Thanks Crawford!

Now for a couple of small bug reports/notes for the documentation:

  • For the exclusion list, when you say comma separated, you mean it. If you include a space, the space is apparently part of the search string and thus you don't (necessarily) find your exclusion
    • Yup. Could easily make it ignore spaces as well.
  • If you run multiple publish runs on the same day, with different settings, you overwrite the zip file. This might be good or bad.
    • Yup
  • What is the suggested best way to exclude attachments? I'm playing with regex stuff right now.
    • There isn't one. WHat do you suggest?
  • PUBLISHSKIN in the PublishWeb example doesn't seem to be acknowledged... it always uses the value for SKIN. I found a couple of references in the script and I'm playing with fixing that, but you probably will get there before I do.

Ah, now I think I see... on line 151 it refers to SKIN and pulls it from the Preferences, instead of the local file? Anyway, I changed this to PUBLISHSKIN and set a WebPreferences value for it and it works!

That really doesn't do quite what you are aiming for, but it gets me working until somebody that really knows what they are doing has a chance.

    • That sounds right. I changed SKIN to PUBLISHSKIN because setting SKIN in a topic changes the skin in the browser, which was 'orrible frown
      • Yep, ran into that smile Since I'm not really good at this, is there a reason it ignores the PUBLISHSKIN value in the PublishWeb page and instead takes it only from WebPreferences? At least that's how I read the code.
        • Probably just my stupidity. If you can make it work, please do so and contribute back a patch.
Now I'll see if I can wear out my welcome... any way to make it execute or %ACTIONSEARCH% stuff from the ActionTrackerPlugin?
    • Hmmm - it should be doing that - certainly it's working for me. Any other data?
      • Oppps. I was partly wrong. stuff works... its just the %ACTIONSEARCH% that doesn't. I'll play some more and see, but my output (html) just has the %ACTIONSEARCH... command

-- BruceDillahunty - 14 Apr 2005

I'm having problems with this when trying to use any PatternSkin (or derivative) skin. The URIs in the style references are being rewritten from the desired http://servername/twiki/pub/TWiki/PatternSkin/layout.css to http://servernamersrc/TWiki/PatternSkin/layout.css. From a quick code review, I imagine the sub copyResource (around line 324 of Publish.pm) is responsible. I'm not immediately clear what is going on, so before I do lots of work, has someone else got any advice?

-- ScottClaridge - 27 Apr 2005

RE: SKIN setting from PublishWeb; How about:

    if (! $skin) {
       $skin = $query->param('publishskin') ||
Note that the PublishAddOn page needs % SKIN% changed to %PUBLISHSKIN% (about line 56)

(oops - I think i almost wiped out half this page on the last edit. Not sure why that happened)

-- ScottClaridge - 27 Apr 2005

Hmmmm - I tested the rewriting of the style URIs and it was all working OK for me. If you are having a problem with them, chances are good that there are other problems as well (e.g. with attachments).

I fixed the PUBLISHSKIN problem in release 1.301. I also made PUBLISHSKIN and SKIN synonymous in PublishWeb.

Oh, and I added a WIBNIF list to the bottom of this topic. I don't intend to implement any of these, unless someone pays me to do so, but I thought it would be good to have a collective memory of ideas.

-- CrawfordCurrie - 27 Apr 2005

Looking more at this, this morning, I see that my rsrc problem is because of the attachment copying part of the process. However I am not getting any attachments copied into my zip file. Am I missing a parameter (which i can't see) or is it broke? (You mention release 1.301; I'm seeing only 1.3 from 11 Apr 2005.)

-- ScottClaridge - 27 Apr 2005

Well, the attachment copying works ok for me in 1.3, so 1.301 probably isn't going to cure your problem. There is unlikely to be any missing parameter. Are you using https: urls, by any chance? That might have an affect.

-- CrawfordCurrie - 28 Apr 2005

Wanted to provide feedback: I've installed the latest addon and tested on a small set of pages. Works fine and I have no obvious issues so far, attachments are published as supposed to be. Excellent feature!

-- TiborGellert - 29 Apr 2005

No - no https, although I ultimately want to move it to a wiki with ssl enabled. If that a problem?
I'll have to have a closer look at what is going on. Whether I am an idiot (most likely) or whether my setup has a problem.

-- ScottClaridge - 03 May 2005

Scott, I may have an answer for you on your query above about http://servernamersrc/TWiki/PatternSkin/layout.css. I got the same thing, then it finally dawned on me that it was the PUBLISH_URL value that the installer sets in lib/TWiki/Contrib/PublishAddOn/PublishAddOn.cfg. It just needed a trailing slash. So instead of http://localhost/export I put http://localhost/export/ and it worked. Hope this helps.

-- MarcusLeonard - 07 May 2005

While I'm here, here's an idea I've tried that works well. (Apologies if this is the wrong place to post this.) This method creates exported pages that can look nothing like TWiki, but whatever site layout and style you want.

  • Create a couple of template topics that contain your intended exported page headers and footers. They may not display properly in TWiki if you use tables for formatting, but this doesn't matter. Your header topic can include navigation bars, etc, and may include the start of a "broken" table that you close in the footer topic.
  • Create one or more topics for your page content, with INCLUDEs of your template topics at the top and bottom. It's easy to make a template for this topic also, if want to generate lots of content pages. Now all your "content" topics have the same header and footer controlled from one or two places.
  • Export all the content pages using this add-on, using the plain skin. When you extract it, you've got your website.
  • To change the whole look of your website, change your template topic(s) and export again.

-- MarcusLeonard - 07 May 2005

Thanks Marcus. Over the weekend I just noticed this, and the fact that I had an incorrectly configured $pubDir var in my test setup :o. The / works for some things, but doesn't seem to work for the CSS stuff in pattern template. Possibly a misplaced / in there as well - or the plugin is being a bit over zealous.

-- ScottClaridge - 10 May 2005

I'm seeing this error in my /var/log/apache2/error_log

[Fri Sep 02 07:07:49 2005] [error] [client client_IP] [Fri Sep  2 07:07:49 2005] publish: Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/lib/perl5/5.8.6/i686-linux/Socket.pm line 373., referer: http://private_IP/twiki/bin/view/TWiki/PublishWeb
I'm using gentoo, perl 5.8.6, apache 2.0.54, twiki 20040901. Anybody seen this?

-- CarterSmithhart - 02 Sep 2005

I tracked the error to a line in publishTopic() when trying to publish this twiki page: IncludeTopicsAndWebPages. This line causes the error in my comment above:

$text = TWiki::Func::expandCommonVariables($text, $topic, $web);

-- CarterSmithhart - 02 Sep 2005

I assume that all of the attachments/submittals were included in the April 28th, 2005 release of this plugin? i.e. it's pointless for me to try to play with the attachments since the April 28th version included all of them. Right?

-- CarterSmithhart - 07 Sep 2005

Carter, the error you are seeing is coming from the depths of the Perl Net module, and I strongly doubt it is anything to do with TWiki or the plugin. You don;t say what impact this error is having on your ability to publish.

The latest release should include everything you need, yes. I haven't done anything on the plugin since then.

-- CrawfordCurrie - 07 Sep 2005

Scott (and others with the http://serverrsrc/... problem),

I have also been seeing the same problem, using version 1.301 from the PublishAddOn download page. I've made a couple of changes in Publish.pm which seems to have fixed it: ensure that $ENV{HTTP_HOST} is set correctly in TWiki::Contrib::Publish::main and use "(?:http://$ENV{HTTP_HOST})?" instead of '(?:http://localhost)?' in TWiki::Contrib::Publish::publishTopic

See patch 301-302 attached. This patch also removes %COMMENT% tags and <input> fields from the rendered output to prevent users who see the static pages from accidentally modifying the 'live' stuff

-- MagnusLewisSmith - 08 Sep 2005

Excellent, thanks Magnus. I'm not going to take the COMMENT and input filters into the source, for two reasons; first, PublishAddOn should be WYSIWYG, and second, publishers may well want the comments/inputs. Consider the example of a cooperatively authored book, where the comment box can be used to gather comments on the published version in camera.

If this is a key requirement, can I suggest that there are other plugins besides COMMENT that may need to be filtered, so a general filtering mechanism is really required rather than a one-plugin hack?

Oh, an alternative would be to post-process the generated HTML and add disabled="disabled" to all the input, textarea, and button tags (and any other input type tags I've forgotten)

The rsrc fix will be in 1.302, along with updates for DakarRelease.

-- CrawfordCurrie - 09 Sep 2005

I'm not convinced by the fix for serverrsrc in the above proposed 1.302. Given that CairoRelease has:

    $_[0] =~ s/%PUBURL%/$urlHost$pubUrlPath/g;

and DakarRelease will have something like

    $this->{SESSION_TAGS}{PUBURL}         = $this->{urlHost}.$TWiki::cfg{PubUrlPath};

we should expect all references to attachments etc. to have a prefix corresponding to the urlHost value. Therefore shouldn't we be searching for the urlHost value rather than for something which depends on $ENV{HTTP_HOST} ? This becomes particularly important if $doRemovePortNumber is set, or if https is being used instead of http (does anyone do this?) But even without $doRemovePortNumber set, on my installation I see $ENV{HTTP_HOST} always including :80, whereas $urlHost and consequently all %PUBURL% and %ATTACHURL% expansions do not include the port, therefore Magnus' patch fails.

-- AdamSpiers - 13 Sep 2005

Just wanted to add my thanks again to all those who have helped with this addon. Our site uses a combination of PublishAddOn, TreePlugin and some templates to automatically generate a sidebar with navigation menu. The internal site (a proper TWiki, editable by staff) is published to our public site regularly. We have some automated scripts to find-and-replace selected WikiWords within the published html. Some of our products have WikiWords in their title - we want them to show up as WikiWords in (say) the treeview and page titles. Thanks again, all.

-- RossC - 05 Oct 2005

Bug fix: I have corrected an apparent typo in, lib/TWiki/Contrib/Publish.pm:sub publishTopic:270. I have changed changed !~ to =~ in publishTopic:270 so that TOPICSEARCH pattern will be excluded as intended by design. The change is commited to cvs.sourceforge.net:/cvsroot/twikiplugins.

-- AlexKane - 12 Oct 2005

Here's a small patch to make current version (1.301) publish in a dir, besides a ZIP file.


-- PabloHoffman - 17 Oct 2005


NOTE: If anyone has time to address some of the reported issues with this addon, it would be very welcome; I don't have time to maintain it, and nobody else has picked up the ball yet.....

-- CrawfordCurrie - 04 Nov 2005

I used this great plugin successfuly to publish two twikis from 2005 releases. However, I desperately need to publish one from 2004 with a Feb. 2003 twiki release. The publish addon I downloaded at the time has never worked, and when I try to use the current one, I get the following error:

Undefined subroutine &TWiki::Func::formatTime called at ../lib/TWiki/Contrib/Publish.pm line 164.

Is there some fairly simply upgrade I can drop in? If I can publish what's there, I don't need the twiki installation to function anymore. Any help greatly appreciated! --

-- JohnNorvell - 31 Jan 2006

Is there a way to make this work with other plugins? I'm using both the TocPlugin and the LatexModePlugin, and neither of these seem to work with the PublishAddOn.

For example, my %REF{}% LatexModePlugin tags appear, unresolved, in the published version. And my section headings, and instead of section numbers, I get Topic WebHome not in WebOrder messages.

-- DomLayfield - 06 Feb 2006

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-02-27 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.