HI Mike. Brilliant. Matches more-or-less what I expected (that using directory-create hooked into a bigger beast under the hood that was more than I needed). I am happy with 'implied' directories and still have the ability to put a property on these fragments when needed.
To be honest, I never thought of running xdmp:plan on the cts:directory call.. That makes sense, but that Idea passed well over my head. Kind Regards, David On 29 March 2014 14:50, Michael Blakeley <[email protected]> wrote: > Have you read > http://blakeley.com/blogofile/2012/03/19/directory-assistance/ yet? > > -- Mike > > On 28 Mar 2014, at 23:08 , David Ennis <[email protected]> wrote: > > > HI. > > > > I am curious of the reason to use directory-create vs just attaching > information to URIS ending on '/' > > > > creating directories allows for permissions, stec. This seems to be > managed via properties on the path. > > > > If I do not need granular permission control, then what is the benefit > of using xdmp:directory-create> > > > > Take this example: > > xquery version "1.0-ml"; > > declare namespace html = "http://www.w3.org/1999/xhtml"; > > > > (:let $dir1 := xdmp:directory-create('/foo/'):) > > let $fakedir := xdmp:document-set-properties('/foo2/', > <some_information>baz</some_information>) > > let $insert := xdmp:document-insert('/foo/file1.xml', <something/>) > > let $insert := xdmp:document-insert('/foo2/file1.xml', <something/>) > > > > > > return <results> > > > <my_directory_listing>{xdmp:directory("/foo2/")}</my_directory_listing> > > > <properties_of_fake_dir>{xdmp:document-properties('/foo2/')}</properties_of_fake_dir> > > </results> > > > > - I can put a property on /foo/ - allowing me to keep 'directory-level' > information > > - I can use xdmp:directory as well (even though it is not internally > tagged as a directory) > > - I can also use cts:uri-match for other uses, etc > > > > So.. Other than granular permissions, what benefit to I get by using > 'directories' rather than building on the sample above? > > > > Regards, > > David > > _______________________________________________ > > General mailing list > > [email protected] > > http://developer.marklogic.com/mailman/listinfo/general > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
