Hi devs,
I'd like to add a preview link next to office attachments in the
attachments tab (See http://jira.xwiki.org/jira/browse/XAOFFICE-11 ). I
was thinking to create a new velocity template, officepreview.vm, and
use it like this:
$doc.getURL("view",
"xpage=officepreview&attachment=$escapetool.url($attachment.filename)")
Another option is to add a new action (i.e.
/xwiki/bin/officepreview/Space/Page/presentation.ppt ) or reuse an
existing one (i.e. /xwiki/bin/preview/Space/Page/presentation.ppt ).
WDYT?
Thanks,
Marius
Hi devs,
Since this is an important public change, we need to vote on it. This is the vote for the mail thread:
http://markmail.org/message/drm6jq4mosjbryew
First some terminology:
[[label>>target||params]]
The vote is on moving query string and anchor information from the link target to link parameters.
Rules:
* This is for XWiki Syntax 2.1 only
* The target part is there to specify what the link is targeting. QueryString and Anchors do not serve to specify the target. They're just used at render time to control the display. Hence the rationale why they are specified as link params and not as part of the target. Note that for an interwiki link, the interwiki alias is part of the target since it serves to specify the target.
* We name the param "queryString" so that it's clear what it is. We can always change it later on with no backward compat issues if we want something more isolated from URLs but we don't see the need now. The user has to write a valid query string including any URL-encoding required.
* Example: [[label>>doc:docReference||queryString="a=b&c=d" anchor="anchor"]]
Here's my +1
Thanks
-Vincent
Hi devs,
I was playing with the office preview script service when I discovered
that $services throws ScriptServiceNotFoundException when there's no
script service registered for the specified hint, e.g. $services.foo . I
was expecting $services to return null when it fails to locate a
service. I even wrote:
#if($services.officepreview)
{{html}}
$services.officepreview.preview(...)
{{/html}}
#else
{{error}}The office preview component has not been installed.{{/error}}
#end
What do you think it's best: to throw ScriptServiceNotFoundException or
to return null?
Anyway, I think there should be a method to check if a script service is
available (
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-script/src/mai…
).
WDYT?
Thanks,
Marius
Hi devs,
If I write:
{{groovy}}
print
com.xpn.xwiki.web.Utils.getComponent(org.xwiki.model.ModelContext.class).getCurrentEntityReference();
{{/groovy}}
in a wiki page I get:
name = [xwiki], type = [WIKI], parent = [null]
I was expecting to get a reference to the current page (i.e. the page
that executes the groovy script). The javadoc of ModelContext interface
says:
"Allows accessing Model Objects for current objects (current document,
current wiki, current space, etc) placed in the Execution Context."
Looks like DefaultModelContext (
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-model/src/main…
) always returns a WikiReference. What was the rationale behind this?
Thanks,
Marius
Hi devs,
I'm going to continue Asiri's work on integrating officepreview module (
http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-officepreview/
) into the main source tree. Following the discussion at
http://xwiki.475771.n2.nabble.com/Discussion-Integrating-officepreview-modu…
here are the steps that need to be taken:
* Extend DocumentAccessBridge with a method to get the current version
of an attachment in order to drop the dependency on xwiki-core:
String getAttachmentVersion(AttachmentReference attachmentReference)
* Convert OfficePreviewVelocityBridge to a ScriptService:
$services.officepreview.preview($attachmentReference, $filterStyles)
* Move /contrib/sandbox/xwiki-officepreview/ to
/platform/core/xwiki-officepreview
* Publish the office preview wiki macro on code.xwiki.org
* Integrate office preview in the UI (e.g. button/link to preview, next
to download links in the attachments tab)
Let me know if you don't agree with some of these steps. The goal is to
have the office preview module in platform ready to use before the 2.5M2
release.
Thanks,
Marius
Hi,
The discussion started in http://xwiki.markmail.org/thread/hqvmy34jfknb2waa but since it's an important decision I'm making it a full thread here.
The idea is to know how we want to represent query string and anchors in links to documents in XWiki Syntax 2.1.
In 2.0 we were using: [[label>>whatever?queryString#anchor]]
The proposal is to move query string and anchor to a link parameter.
It be done like this:
[[label>>doc:mypage||parameters="a=b&c=d" anchor="..."]]
We could decide to use another syntax for parameters (ie query string) such as:
[[label>>doc:mypage||parameters="a=b,c=d" anchor="..."]]
This would make it a little bit less URL-specific.
The pros of this approach are:
- no need for the user to escape the ? and # characters in document names
- makes the syntax a little bit less "magic" and more formal
The cons:
- Takes a bit longer to write
- A new syntax to learn
WDYT?
Thanks
-Vincent
Hello all.
First of all, I'd like to say that I'm kind new in the XWiki project
and in this mailing list so, I apologize if this is an already
reported issue I'm not aware of (I looked for open issues related to
the customization of the PDF pages when exporting from XWiki but I
found nothing related to what I'm about to share with you):
I'm using XWiki 2.4 and I cannot make the example in
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Configuration#HCustomiz…
related to the configuration of the field style work. After some
debugging, I found out why: basically, the example states that we
should use a field of type TextArea for the style property of the
PDFClass class. However, when doing so, at runtime, when getting the
value of my "style" field, I don't get what I actually wrote there,
because a new paragraph is inserted around my content, resulting in
something like:
<p>
h2 {
margin-left: 2cm;
margin-bottom: 1cm;
color: red;
}
h3 {
margin: 3cm;
color: yellow;
}
</p>
I thought the problem might be with the editor that was used for
editing the field or something, so I forced using the Text editor but
still had no results. This example only worked when I used a String
property instead of a TextArea (which is a real "pita" right?).
I'd like to know:
1 - Am I doing something wrong?
2 - Is this a known bug and I couldn't find information about it?
3 - If this is really a bug, can I help fixing it or something similar?
Regards,
Paulo Zenida
Hi,
I thought it would be good to summarize the rules I'm implementing/fixing relative to escaping in link references for both XWiki Syntax 2.0 and the new XWiki Syntax 2.1 I have started. This will later go in the XWiki Syntax page on xwiki.org.
There are 2 set of rules:
- For entity references
- For link references
Entity References
==============
The rules are (independent of the XWiki Syntax):
- if you need a \ in any part of the reference then you need to double it with \\
- For a : in a space name it's \:
- For a . in a page name it's \.
- For a @ in an attachment name it's \@
- For a ^ in an object name it's \^
- For a . in an object property name it's \.
Link References
=============
For XWiki Syntax 2.0
----------------------------
The rules are:
- if the link reference points to a document and you want a ?, #, @ or \ in any part of the reference you need to escape them with \?, \#, \@ or \\.
Note that when resolving a link reference to a document the link reference escapes are first unescaped and then the entity reference is unescaped. For ex for: [[label>>my\.page]] will result in a link to a page named "my.page" and [[label>>my\?page]] to "my?page".
- if link reference points to a mailto then no escaping is performed at all. Thus [[label>>mailto:john\@whatever.org]] will generate in HTML <a href="mailto:john\@whatever.org">john\(a)whatever.org</a>
- same for link refs to URLs
- For link to attachments, only the entity reference escape is performed, no additional escape is done for the link reference.
- For link to interwiki, if the interwiki path needs a @ then it must be escaped with \@. Same for the interwiki alias. Example: [[label>>what\@ever@wiki\@pedia]]
For XWiki Syntax 2.1
----------------------------
The rules are:
- if the link reference points to a document and you want a ?, # or \ in any part of the reference you need to escape them with \?, \#, or \\.
- if link reference points to a mailto then no escaping is performed at all.
- same for link refs to URLs
- For link to attachments, only the entity reference escape is performed, no additional escape is done for the link reference.
- For link to interwiki, no escaping is performed at all (and ":" is not allowed in the interwiki alias). Example: [[label>>interwiki:wikipedia:what\\ever]] will generate an interwiki path of what\\ever
Open Questions
=============
Do we want to allow \\ in any link references (mailto, attach, interwiki, url, etc) and unescape it to \ or should we keep the rules defined above?
Thanks
-Vincent