snippet to determine if page exists

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

snippet to determine if page exists

Duke Tantiprasut
Hi All,

How do you check whether a page exists?
$xwiki.getDocument() returns a valid $doc, even for pages that doesnt exist.

Thanks.

Duke




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: snippet to determine if page exists

Ludovic Dubost

Once you have a document there is $doc.isNew()
There is also $xwiki.exists("Main.WebHome")

Ludovic

Duke Tantiprasut wrote:

> Hi All,
>
> How do you check whether a page exists?
> $xwiki.getDocument() returns a valid $doc, even for pages that doesnt exist.
>
> Thanks.
>
> Duke
>
>
>  
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: snippet to determine if page exists

Duke Tantiprasut
great thanks.

> -----Original Message-----
> From: Ludovic Dubost [mailto:[hidden email]]
> Sent: Thursday, September 01, 2005 11:53 PM
> To: [hidden email]
> Subject: Re: [xwiki-users] snippet to determine if page exists
>
>
> Once you have a document there is $doc.isNew() There is also
> $xwiki.exists("Main.WebHome")
>
> Ludovic
>
> Duke Tantiprasut wrote:
> > Hi All,
> >
> > How do you check whether a page exists?
> > $xwiki.getDocument() returns a valid $doc, even for pages
> that doesnt exist.
> >
> > Thanks.
> >
> > Duke
> >
> >
> >  
> >
> ----------------------------------------------------------------------
> > --
> >
> >
> > --
> > You receive this message as a subscriber of the
> [hidden email] mailing list.
> > To unsubscribe: mailto:[hidden email]
> > For general help: mailto:[hidden email]?subject=help
> > ObjectWeb mailing lists service home page:
> > http://www.objectweb.org/wws
> >  
>
>
> --
> Ludovic Dubost
> XPertNet: http://www.xpertnet.fr/
> Blog: http://www.ludovic.org/blog/
> XWiki: http://www.xwiki.com
> Skype: ldubost AIM: nvludo Yahoo: ludovic
>
>
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws