[pmwiki-users] Linking WikiForms to WikiForms

John Rankin john.rankin at affinity.co.nz
Tue Aug 22 18:12:29 CDT 2006


On Tuesday, 22 August 2006 5:20 PM, Hsing-Foo Wang <hsingfoo at gmail.com> wrote:
>Some questions if I may:
>
>> - Specify the type of form to use with a "group suffix"
>>
>>   If you have groups ProjectX-Issue and ProjectX-Activity the
>>   recipe will use Issue.FormTemplate and Activity.FormTemplate,
>>   so ProjectX-Issue and ProjectY-Issue will both use the
>>   Issue.FormTemplate. This gives separate issue lists for ProjectX
>>   and ProjectY, but using the same template.
>
>Got this one, except I now focussing on handling projects by their
>number and thus page instead of group for each project. This will give
>(somehow) the opportunity to have a seperate 'total view' of all
>issues and activities where each issue and activity 'record' has a
>(hidden?) field related to the projectpage based on the projectpage
>suffix (e.g. 00001)
>Dunno yet if my approach is feasable...

A PmWiki group has to start with an uppercase letter, so you'll need 
to make the groups P00001-Issue, P00001-Activity, and so on. So you
have a Project.00001 page, that points to the P00001-Activity group,
a Project.00002 page that points to a P00002-Issue group, and so on.
>
>>
>> - Specify a form page title with the (title) field type
>>
>>   This will cause the page named Project.00001 to have a title,
>>   such as ProjectX. It also creates the option of generating
>>   markup of the form: (:wikilist group={$Title}-Issue :) to
>>   produce a list of issues for the current project. Note that
>>   you don't have to give each project a title unless you choose
>>   to; you can have groups 00001-Issue, 00001-Activity and this
>>   will work too.
>
>Same here, chewing on projects based on groups or projects based on
>individual pages. I now use project pages and groups for issues and
>activities (e.g. projects.00001, activities.00001 and issues.00001)
>Again, this way I can browse ALL projects, issues and activities with
>the (:wikilist:) directive. Now how to have the sepcific issues and
>activities listed AND created per individual project page ;-)

Let's take Issue as an example, from which we can generalise to other
project attributes. As I understand your data model, there is a one 
to many relationship between a project and its Issues.
So you have 2 options:

a) the option above, where you make the project identifier part of
   the group name and have separate Issue groups for each project;
   thus P00001-Issue.00003 is issue 3 for project 1

b) have a Project group and a single Issue group, and make the
   project number an attribute of the issue; thus Issue.00001
   may have an attribute Project.00002 and Issue.00002 may have
   an attribute Project.00005

I think option b is harder to maintain, because you have to
know the project number whenever you create a new Issue.
With option a, you navigate from (say) Project.00007 to
P00007-Issues.NewIssue, so the next issue is automatically
associated with the correct project.
>
>>
>> - Make a field take a particular value with the (hide) type
>>
>>   This option should let you generate the required wikilist
>>   markup automatically when you create a new project. This
>>   feature *does not* currently provide the capability you
>>   need, as you can't properly insert (: ... :) markup
>>   inside a "hide" field value. At the moment, you will
>>   need to enter the required markup manually, but a fix
>>   may be fairly straightforward.
>
>ok, read the above, chewing on what you try to explain exactly.
>More to come.

You need to insert the following markup on Project.nnnnn pages:

    (:wikilist group=P{$Name}nnnnn-Issue :)

to get a list of the issues for the current project -- PmWiki
translates this into group=Pnnnnn-Issue so you get a list of
issues for the specified project
>
>>
>> - Define a new markup to extract the group prefix
>>
>>   You'll need a way to generate a link from 00001-Issue to
>>   Project.00001. This will require you to define a new
>>   format variable, {$GroupPrefix} that extracts the text
>>   from in front of -... in the group name. Then you can
>>   put this in a GroupHeader or GroupFooter in the issue
>>   and activity groups, to link back to the project page.
>
>I have no expertise in creating custom Markup's, dunno if this is
>needed yet. I guess that depends on the structure of projects and
>related items (per page or per group)

Once the above approach is working, adding this bit will be
easy; so put it to sone side for now.
>
>>
>>
>> The above may give some useful ideas for how to get started.
>> I'd be inclined to omit the title option in the first
>> instance and focus on getting the overall group and page
>> structure working, using numeric page names for everything.
>
>Agree
>
>Thanks for your help.
>
>-HF
>
>


-- 
JR
--
John Rankin







More information about the pmwiki-users mailing list