[Pmwiki-users] Re: Publishing a part of your wiki -- Experience using PmWiki

chr@home.se chr
Thu Sep 16 17:06:29 CDT 2004


On Thu, 16 Sep 2004, Patrick R. Michaud wrote:

> On Thu, Sep 16, 2004 at 10:46:59AM +0200, chr at home.se wrote:
> > 
> > IMO the concepts are independent.  In my mind I'd actually almost like to 
> > have a compeletely separate wiki (field?) for the public part, but allow 
> > the public wiki to "import" some pages from the private wiki. I'll have to 
> > read the rest of the comments and reply to them a bit later however.

I think I've missed emphasizing an aspect here. For the public wiki, I
needed to be able to have a separate sidebar. The reason is that the
regular sidebar would reveal too much. Just like how a link to a private
page could reveal too much if it is rendered as a link, even if the user
is not allowed to see the private page when he clicks on the link.

The whole process I would have like to go through might be described as 
follows:
# Use private wiki to prepare documents and make notes etc.
# Work on pages adding specifications and data, intended for public wiki
# Create public wiki
## Create sidebar in public wiki
## Import pages from private wiki
# Allow outsiders to edit pages, primarily to add questions/comments
# Compare changes/comments to original (private) page, and possibly 
  apply changes to it. Then re-import page to public wiki

Actually, when I think about it... in my case, if I allowed outsiders to 
modify the pages, I would have had to create several public wikis. All the 
public wikis would in this case "import" the same pages from the private 
wiki. That would not have to be the case in general of course.

In addition, if the outsiders (guests?) are allowed to modify the pages, 
they will be able to see the source. This means that links to private 
pages (in the form of {{some private page}}) would have to be stripped 
during the import process.

Then there would also be a need for a way to compare the page to it's
original version, i.e. to see how it has been changed since it was first
imported. This is something you would do in order to (manually) apply some
of the changes to the original (private) page. After that, you would
probably want to import the page again to the public wiki(s).

I hope it's slightly clearer what I'm looking for here... Since I can't
explain exactly how/when I needed this, maybe I should try and come up
with a completely fake scenario? Would that help explain the need?

> Well, here's an idea -- possibly (probably?) a bad one, but it does point
> a direction for discussion.
> 
> Background:  I'm already considering the addition of a [:cloak:] directive 
> to pages that will allow such pages to be automatically excluded from 
> pagelists, search results, etc.  It doesn't make them private/protected--
> it just means they don't show up by default when lists of pages are
> generated.

That would actually be convenient for other things. For instance, I often
create a page called 'PageList' which simply lists pages with a
description. This is a page where I'd use [:cloak:] to keep it from
appearing. 'Main.SideBar' is another example.

> Going the other way then, one could define a [:public:] directive that
> marks a page as being available for others to search.
[edit]
> I'd create the public part as a separate wiki field, and create a
> special PageStore object that returns pages from the private wiki's dir
> only if the page's text contains [:public:].
> 
> Thus, in the public wiki:
> 
>     $WikiLibDirs = array(
>         // pages from the private wiki field
>         new PrivateStore('.../privatefield/wiki.d/$PageName'),   
>         // the public wiki field's read/write area
>         $WikiDir,                              
>         // the farm's default library
>         new PageStore('$FarmD/wikilib.d/$PageName'));

Um.. would you add one 'new PrivateStore...' for each page you want to
import?  Guess I don't understand why the '$PageName' is in the code. Or
what 'PageStore' does for that matter... (I've not even glanced at the
source of PmWiki 2.0 yet)

> The code for PrivateStore would look something like:
> 
>     class PrivateStore extends PageStore {
>       function read($pagename) {
>         $page = parent::read($pagename);
>         if (@$page['text'] && strstr($page['text'],'[:public:]')!==false))
>           return $page;
>         return false;
>       }
>     }
> 
> So, whenever someone on the public wiki requests a page, it looks
> in the private wiki's directory first for a page with [:public:] and
> uses that if it exists, otherwise it falls through to the other dirs.
> If the public wiki attempts to edit the page, it gets saved in the
> public wiki's directory ($WikiDir), and given the way I've defined
> $WikiLibDirs above, it'll be hidden by the private wiki's version.

Hmm this could be close to what I wanted, I'm not sure. Hopefully what I 
wrote at the top will let you determine that :-)

Although I am wondering if maybe I'm looking for something that's much
more advanced than most people would ever need? OTOH, once you can do
something you often start to wonder how you could live without it before.

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list