You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by "Linczak, Jonathan W." <Li...@hiram.edu> on 2005/02/17 14:36:48 UTC
Small fix for create usecase?
Hi all,
While creating a new doctype and new usecase based off of the create usecase, I noticed a small problem with the original create usecase. When you create a new document where the parent ID is "/", the document returned always has 2 "/"s in the URL, so the document is not "chosen" in the authoring environment. So, I added this bit and it seems to fix it:
<map:match pattern="create" type="step">
<!-- Make sure the child-id doesn't exist yet -->
<map:act type="document-id-exists">
<map:parameter name="document-id" value="{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}"/>
<map:act type="task">
<map:parameter name="task-id" value="create"/>
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{request-param:properties.create.parent-id}"/>
<map:when test="/">
<map:redirect-to uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
</map:when>
<map:otherwise>
<map:redirect-to uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
</map:otherwise>
</map:select>
</map:act>
... continues as normal ...
The only change was adding a selector to see if the parent ID was just a slash, and if it was, remove the slash between the parent and child IDs on redirection. Don't know if this was ever noticed or fixed for the newest release, but thought I would offer it here.
Jon
Re: Small fix for create usecase?
Posted by Michael Wechner <mi...@wyona.com>.
jplejacq wrote:
> Michael Wechner wrote:
>
>> Josias Thoeny wrote:
>>
>>> Is this a fix for:
>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=32809
>>>
>>
>>
>> yes, I think so. Maybe JP can check it and close the bug if it's ok.
>
>
> I think so. I'll apply the patch this weekend and close the bug if it
> fixes the problem.
it's already applied within 1.2.x. Just svn up required ;-)
Michi
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Small fix for create usecase?
Posted by jplejacq <jp...@quoininc.com>.
Michael Wechner wrote:
> Josias Thoeny wrote:
>
>> Is this a fix for:
>> http://issues.apache.org/bugzilla/show_bug.cgi?id=32809
>>
>
> yes, I think so. Maybe JP can check it and close the bug if it's ok.
I think so. I'll apply the patch this weekend and close the bug if it
fixes the problem.
--
JP
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Small fix for create usecase?
Posted by Michael Wechner <mi...@wyona.com>.
Josias Thoeny wrote:
>Is this a fix for:
>http://issues.apache.org/bugzilla/show_bug.cgi?id=32809
>
>
yes, I think so. Maybe JP can check it and close the bug if it's ok.
Michi
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Small fix for create usecase?
Posted by Josias Thoeny <jo...@wyona.com>.
Is this a fix for:
http://issues.apache.org/bugzilla/show_bug.cgi?id=32809
Or is it something else?
Josias
On Thu, 2005-02-17 at 21:47 +0000, Michael Wechner wrote:
> Thanks very much for the patch.
>
> I have checked it in.
>
> Michi
>
> Linczak, Jonathan W. wrote:
>
> > Hi all,
> >
> > While creating a new doctype and new usecase based off of the create
> > usecase, I noticed a small problem with the original create usecase.
> > When you create a new document where the parent ID is "/", the
> > document returned always has 2 "/"s in the URL, so the document is not
> > "chosen" in the authoring environment. So, I added this bit and it
> > seems to fix it:
> >
> > <map:match pattern="create" type="step">
> > <!-- Make sure the child-id doesn't exist yet -->
> > <map:act type="document-id-exists">
> > <map:parameter name="document-id"
> > value="{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}"/>
> > <map:act type="task">
> > <map:parameter name="task-id" value="create"/>
> > <map:select type="parameter">
> > <map:parameter name="parameter-selector-test"
> > value="{request-param:properties.create.parent-id}"/>
> > <map:when test="/">
> > <map:redirect-to
> > uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
> > </map:when>
> > <map:otherwise>
> > <map:redirect-to
> > uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
> > </map:otherwise>
> > </map:select>
> > </map:act>
> > ... continues as normal ...
> >
> > The only change was adding a selector to see if the parent ID was just
> > a slash, and if it was, remove the slash between the parent and child
> > IDs on redirection. Don't know if this was ever noticed or fixed for
> > the newest release, but thought I would offer it here.
> >
> > Jon
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Small fix for create usecase?
Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
>> While creating a new doctype and new usecase based off of the create
>> usecase, I noticed a small problem with the original create usecase.
>> When you create a new document where the parent ID is "/", the
>> document returned always has 2 "/"s in the URL, so the document is not
>> "chosen" in the authoring environment. So, I added this bit and it
>> seems to fix it:
is this http://issues.apache.org/bugzilla/show_bug.cgi?id=32809 ?
--
Gregor J. Rothfuss
COO, Wyona Content Management Solutions http://wyona.com
Apache Lenya http://lenya.apache.org
gregor.rothfuss@wyona.com gregor@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Small fix for create usecase?
Posted by Michael Wechner <mi...@wyona.com>.
Thanks very much for the patch.
I have checked it in.
Michi
Linczak, Jonathan W. wrote:
> Hi all,
>
> While creating a new doctype and new usecase based off of the create
> usecase, I noticed a small problem with the original create usecase.
> When you create a new document where the parent ID is "/", the
> document returned always has 2 "/"s in the URL, so the document is not
> "chosen" in the authoring environment. So, I added this bit and it
> seems to fix it:
>
> <map:match pattern="create" type="step">
> <!-- Make sure the child-id doesn't exist yet -->
> <map:act type="document-id-exists">
> <map:parameter name="document-id"
> value="{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}"/>
> <map:act type="task">
> <map:parameter name="task-id" value="create"/>
> <map:select type="parameter">
> <map:parameter name="parameter-selector-test"
> value="{request-param:properties.create.parent-id}"/>
> <map:when test="/">
> <map:redirect-to
> uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
> </map:when>
> <map:otherwise>
> <map:redirect-to
> uri="{document-url:{page-envelope:area}:{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}:{request-param:properties.create.language}}"/>
> </map:otherwise>
> </map:select>
> </map:act>
> ... continues as normal ...
>
> The only change was adding a selector to see if the parent ID was just
> a slash, and if it was, remove the slash between the parent and child
> IDs on redirection. Don't know if this was ever noticed or fixed for
> the newest release, but thought I would offer it here.
>
> Jon
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org