Excellent! 
This is very useful in creating content via tags (custom sitemap for example)
I want the link to protected page created no matter what...


Thanks
 
Amir
 

> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 13, 2007 12:42 PM
> To: [email protected]
> Subject: Re: [magnolia-dev] AccessDenied exception
> 
> If you need full access to a repository use:
> 
> MgnlContext.getSystemContext().getHierarchyManager()
> 
> 
> On 08.06.2007, at 23:18, Amir Mistric wrote:
> 
> > Hi
> >
> > I have a quick question:
> >
> > My custom tag has a method that check if the node exists...
> > So I have something like:
> >
> >         try {
> >             Content c = pageToCheck.getContent(nodeToCheck);
> >             String s = c.getName();
> >             // exists...
> >             log.debug("[" + nodeToCheck + "] FOUND in [" +
> > pageToCheck.getHandle() + "]");
> >             return true;
> >         } catch (PathNotFoundException e) {
> >             // does not exist...
> >             log.debug("[" + nodeToCheck + "] NOT FOUND in [" +
> > pageToCheck.getHandle() + "]");
> >             return false;
> >         } catch (AccessDeniedException e) {
> >             // exists but no access...
> >             log.debug("[" + nodeToCheck + "] FOUND (access 
> denied) in 
> > [" + pageToCheck.getHandle() + "]");
> >             return true;
> >         } catch (RepositoryException e) {
> >             throw new NestableRuntimeException(e);
> >         }
> >
> > My question is regarding AccessDenied exception.
> > Seems to be thrown before PathNotFoundException....Which poses my
> > question:
> >
> >
> > In the example above, when AccessDeniedException is thrown how can  
> > I still check if the node exists?
> >
> > Regards
> > Amir
> >
> >
> >
> >
> >
> >
> >
> >
> > ----------------------------------------------------------------
> > for list details see
> > http://www.magnolia.info/en/developer.html
> > ----------------------------------------------------------------
> 
> 
> ----------------------------------------------------------------
> for list details see
> http://documentation.magnolia.info/docs/en/editor/stayupdated.html
> ----------------------------------------------------------------
> 


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to