On Aug 30, 2009, at 6:45 PM, Anca Luca wrote:
Vincent Massol wrote:
Hi,
I'm implementing support for specifying jars attached to pages and
using them from the script macro.
see
http://jira.xwiki.org/jira/browse/XWIKI-3941 for more details.
(Note that my own need for this is to rewrite our IRC Bot using the
2.0 Rendering to make it more stable.)
For this I need the following changes:
* Introduce new CurrentDocumentNameFactory which extends
DefaultDocumentNameFactory but instead of using "WebHome" if the page
name is not specified, it uses the current document page name.
* Introduce AttachmentNameFactory to parse syntax of the form:
wiki:space.page@filename
* Deprecate in DAB: "String getAttachmentURL(String documentName,
String attachmentName);" and instead replace it with "String
getAttachmentURL(AttachmentName attachmentName);"
* Add in DAB: "List<String> getAttachmentURLs(DocumentName
documentName) throws Exception;" to return all attachments
* I also want to fix AttachmentName which shouldn't extend
DocumentName but instead use it by composition (it's not used right
now).
Note: In the future, we'll also deprecate all *URL() methods in DAB
since the correct way will be to write:
- DocumentName (or AttachmentName)
- new XWikiDocumentURL(DocumentName) (or new
XWikiAttachmentURL(AttachmentName))
- DocumentNameSerializer.serialize(xwikiDocumentURL) --> URL (or
AttachmentNameSerializer.serialize(xwikiAttachmentURL))
I don't understand what this (third point) means, could you detail?
The idea (in the future) will be to either manipulate Document names
or Documents. DocumentNames should be preferred whenever possible
since you don't need access to the DB to manipulate them.
Once you have a DocumentName you can construct a XWiki URL object (see
xwiki-url for details).
Once you have a XWiki URL object you can seralize it to a real URL for
example.
Hope it's more clear :)
-Vincent
otherwise it sounds normal,
+1
Happy coding,
Anca
>
> Here's my +1 to these and to add them in RC1.
> Note: I'd like to have this in 2.0 final because I think it's cool to
> have support for XWIKI-3941 but also because we'd need it on
>
xwiki.org
> too in order to be able to use the IRC Bot I'm fixing.
>
> Thanks
> -Vincent