Hi,
On 08/02/2010 02:44 PM, Ivan Levashew wrote:
Hello!
I'd like it to be possible to create links with default labels.
I mean, [[Space.Page]], [[
http://website/]] without "label>>".
Speaking for myself, I'd like magnet links to have default labels
mostly.
I have recompiled WYSIWIG editor several times, and I
have added new
Wizard steps, so I've got some experience with GWT.
Great!
I'm thinking about several use cases. The user should be able to
enter magnet link as is. The user should be able to construct magnet
link from scratch. And a hybrid use case: the users enters a magnet
link in the first wizard step and improves it in the second one. An
improvement is e. g. changing file name, adding alternative
source and so on. I'm implementing two wizard steps: "enter" and
"improve".
Most often, it is wanted a label to be default. Default magnet
label generator produces things like
"klein_shock_doctrine.djvu (8.19 Mb)". These default labels mirror
a content of magnet links in a human-readable form.
The default link label must not be hard-coded in the WYSIWYG editor
since it is need also when rendering the page in view mode. The
rendering module should have control on the default link label and
should allow administrators to configure it. There is something already
implemented but only for wiki page links (look for
"rendering.linkLabelFormat" in xwiki.properties file).
Also, note that the rendering module generates a specific link meta data
when the link label was automatically generated:
<!--startwikilink:Main.WebHome--><span class="wikilink"><a
href="/xwiki/bin/view/Main/"><span
class="wikigeneratedlinkcontent">WebHome</span></a></span><!--stopwikilink-->
Notice the wikigeneratedlinkcontent class. Ideally the link label should
be read-only (in the rich text area) if it was generated automatically
and the meta data should be updated whenever the user edits the link
label through the wizard (add wikigeneratedlinkcontent when label is
left empty and remove wikigeneratedlinkcontent when label is modified).
This doesn't happen right now though.. but extending the link wizards to
support magnet links with default link label should follow this process.
But it is not obvious how to achieve this. I've tweaked GWT editor
to allow empty labels in magnet links, but such links look empty in
WYSIWIG and are being deleted on save.
Indeed, empty anchors are removed in a cleaning filter on the server
side, before the content is converted to wiki syntax. I think we need a
new method in the WikiService to retrieve the default link label for a
given link type. The insert/edit link wizards will then query the server
for the default link label when the user leaves the label input empty.
Hope this helps,
Marius
P.S.: If you have any patches to the WYSIWYG editor don't hesitate to
attach them to a JIRA issue and I'll try to commit them asap.
--
If you want to get to the top, you have to start at the bottom
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs