Hello,
If you're in a component and your objective is to get a DocumentReference,
you could use the DocumentReferenceResolver instead:
import org.xwiki.model.reference.DocumentReferenceResolver;
// ...
@Inject
private DocumentReferenceResolver<String> docResolver;
For the dots issue, I didn't test but I think you can escape those that
should not count, like:
$xwiki.getDocument("MySpace.My\.Dot")
By default it would consider the last '.' dot as the space/page separator.
BR,
Jeremie
2014-08-19 15:06 GMT+02:00 Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr>fr>:
Hello,
I try to obtain DocumentReference from space name and page name with
getDocument(String space, String fullname)
Parameters:
space - Space to use in case no space is defined in the provided
fullname
fullname - the full name or relative name of the document to load
but is doesn't work with dot in document name...
My example:
document $xwiki.getDocument("MySpace",'My.Dot').getDocumentReference()
return xwiki:My.Dot rather than xwiki:MySpace.My\.Dot
and
document
$xwiki.getDocument("MySpace",'MySpace.My.Dot').getDocumentReference()
return xwiki:MySpace\.My.Dot :-/
Any idea how I can obtain DocumentReference?
(use a regexp seem to be heavy way :-) )
Thxs
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users