You just broke pretty much all applications for stable branch...
On Wed, Sep 22, 2010 at 03:44, abusenius
<platform-notifications(a)xwiki.org> wrote:
> Author: abusenius
> Date: 2010-09-22 03:44:29 +0200 (Wed, 22 Sep 2010)
> New Revision: 31216
>
> Modified:
> Â platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Registration.xml
> Â platform/xwiki-applications/trunk/blog/src/main/resources/Blog/CategoriesCode.xml
> Â platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Migration.xml
> Â platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Publisher.xml
> Â platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationGuestActions.xml
> Â platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationMemberActions.xml
> Â platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/WebHome.xml
> Â platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterAdmin.xml
> Â platform/xwiki-applications/trunk/panels/src/main/resources/Panels/DocumentInformation.xml
> Â platform/xwiki-applications/trunk/panels/src/main/resources/Panels/PanelLayoutUpdate.xml
> Â platform/xwiki-applications/trunk/wiki-manager/src/main/resources/XWiki/XWikiServerClassSheet.xml
> Log:
> XWIKI-5463: Checking for CSRF tokens in applications
>
> Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Registration.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Registration.xml  2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Registration.xml  2010-09-22 01:44:29 UTC (rev 31216)
> @@ -686,11 +686,16 @@
> Â * @param $doAfterRegistration code block to run after registration completes successfully.
> Â *###
> Â #macro(createUser, $fields, $request, $response, $doAfterRegistration)
> - Â ## See if email verification is required and register the user.
> - Â #if($xwiki.getXWikiPreferenceAsInt('use_email_verification', 0) == 1)
> - Â Â #set($reg = $xwiki.createUser(true))
> + Â ## CSRF check
> + Â #if(${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> + Â Â ## See if email verification is required and register the user.
> + Â Â #if($xwiki.getXWikiPreferenceAsInt('use_email_verification', 0) == 1)
> + Â Â Â #set($reg = $xwiki.createUser(true))
> + Â Â #else
> + Â Â Â #set($reg = $xwiki.createUser(false))
> + Â Â #end
> Â #else
> - Â Â #set($reg = $xwiki.createUser(false))
> + Â Â $response.sendRedirect("$!{services.csrf.getResubmissionURL()}")
> Â #end
> Â ##
> Â ## Handle output from the registration.
>
> Modified: platform/xwiki-applications/trunk/blog/src/main/resources/Blog/CategoriesCode.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/blog/src/main/resources/Blog/CategoriesCode.xml  2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/blog/src/main/resources/Blog/CategoriesCode.xml  2010-09-22 01:44:29 UTC (rev 31216)
> @@ -397,7 +397,7 @@
> Â #end
> Â #set($query = "${query}obj.name = doc.fullName and obj.className = '${blogCategoryClassname}' and doc.fullName <> 'Blog.CategoryTemplate' and doc.parent = ? order by doc.name")
> Â #foreach($item in $xwiki.searchDocuments($query, $parameterValues))
> - Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item))
> + Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item) && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #set($subcategoryDoc = $xwiki.getDocument($item))
> Â Â Â $subcategoryDoc.setParent($categoryParent)
> Â Â Â $subcategoryDoc.save($msg.get('xe.blog.manageCategories.comment.updatedParent'), true)
> @@ -409,7 +409,7 @@
> Â #end
> Â #set($query = "${query}obj.name = doc.fullName and obj.className = '${blogPostClassname}' and doc.fullName <> 'Blog.BlogPostTemplate' and categories.id.id = obj.id and categories.id.name = 'category' and category = ? order by doc.name")
> Â #foreach($item in $xwiki.searchDocuments($query, $parameterValues))
> - Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item))
> + Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item) && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #set($blogEntryDoc = $xwiki.getDocument($item))
> Â Â Â #set($discard = $blogEntryDoc.getObject(${blogPostClassname}).getProperty('category').value.remove($category))
> Â Â Â $blogEntryDoc.save($msg.get('xe.blog.manageCategories.comment.removedDeletedCategory'), true)
> @@ -433,7 +433,7 @@
> Â #set($query = ', BaseObject obj where ')
> Â #set($query = "${query}obj.name = doc.fullName and obj.className = '${blogCategoryClassname}' and doc.fullName <> 'Blog.CategoryTemplate' and doc.parent = ? order by doc.name")
> Â #foreach($item in $xwiki.searchDocuments($query, $parameterValues))
> - Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item))
> + Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item) && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #set($subcategoryDoc = $xwiki.getDocument($item))
> Â Â Â $subcategoryDoc.setParent($newCategoryDoc.fullName)
> Â Â Â $subcategoryDoc.save($msg.get('xe.blog.manageCategories.comment.updatedParent'), true)
> @@ -442,16 +442,18 @@
> Â #set($query = ', BaseObject obj, DBStringListProperty categories join categories.list as category where ')
> Â #set($query = "${query}obj.name = doc.fullName and obj.className = '${blogPostClassname}' and doc.fullName <> 'Blog.BlogPostTemplate' and categories.id.id = obj.id and categories.id.name = 'category' and category = ? order by doc.name")
> Â #foreach($item in $xwiki.searchDocuments($query, $parameterValues))
> - Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item))
> + Â Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $item) && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #set($blogEntryDoc = $xwiki.getDocument($item))
> Â Â Â #set($discard = $blogEntryDoc.getObject(${blogPostClassname}).getProperty('category').value.remove($category))
> Â Â Â #set($discard = $blogEntryDoc.getObject(${blogPostClassname}).getProperty('category').value.add($newCategoryDoc.fullName))
> Â Â Â $blogEntryDoc.save($msg.get('xe.blog.manageCategories.comment.updatedRenamedCategory'), true)
> Â Â #end
> Â #end
> - Â $categoryDoc.getObject('Blog.CategoryClass').set('name', $newCategoryName)
> - Â $categoryDoc.save($msg.get('xe.blog.manageCategories.comment.updatedCategory'), true)
> - Â $categoryDoc.rename($newCategoryName)
> + Â #if ($!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> + Â Â $categoryDoc.getObject('Blog.CategoryClass').set('name', $newCategoryName)
> + Â Â $categoryDoc.save($msg.get('xe.blog.manageCategories.comment.updatedCategory'), true)
> + Â Â $categoryDoc.rename($newCategoryName)
> + Â #end
> Â #end
> Â {{/velocity}}</content>
> Â </xwikidoc>
>
> Modified: platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Migration.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Migration.xml     2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Migration.xml     2010-09-22 01:44:29 UTC (rev 31216)
> @@ -24,7 +24,7 @@
> Â <syntaxId>xwiki/2.0</syntaxId>
> Â <hidden>true</hidden>
> Â <content>{{velocity filter="none"}}
> -#if($request.migrate)
> +#if($request.migrate && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â #set($newContent = '#includeForm("Blog.BlogPostSheet")')
> Â #set($query = ", BaseObject obj where obj.name = doc.fullName and obj.className = 'XWiki.ArticleClass'")
> Â #foreach($article in $xwiki.searchDocuments($query))
>
> Modified: platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Publisher.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Publisher.xml     2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/blog/src/main/resources/Blog/Publisher.xml     2010-09-22 01:44:29 UTC (rev 31216)
> @@ -32,7 +32,7 @@
> Â #end
> Â #set($entryName = "$!{request.entryName}")
> Â #if($entryName != '')
> - Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $entryName))
> + Â #if($xwiki.hasAccessLevel('edit', $xcontext.user, $entryName) && $!{services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â #set($entryDoc = $xwiki.getDocument($entryName))
> Â Â #if ($entryDoc)
> Â Â Â #getEntryObject($entryDoc $entryObj)
>
> Modified: platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationGuestActions.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationGuestActions.xml    2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationGuestActions.xml    2010-09-22 01:44:29 UTC (rev 31216)
> @@ -223,7 +223,7 @@
> Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.accept.alreadyReportedAsSpam'){{/error}}
> Â Â #elseif($status != 'pending')
> Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.invalidStatus', ["#messageStatusForCode($status)"]){{/error}}
> - Â Â #else
> + Â Â #elseif($confirm && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #if("#canGuestAcceptInvitation($doc)" != 'true')
> Â Â Â ##
> Â Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.accept.improperConfiguration'){{/error}}
> @@ -235,6 +235,9 @@
> Â Â Â Â #set($invited = true)
> Â Â Â Â {{include document="XWiki.Registration"/}}
> Â Â Â #end
> + Â Â #else
> + Â Â Â ## CSRF protection
> + Â Â Â $response.sendRedirect("$!{services.csrf.getResubmissionURL()}")
> Â Â #end
> Â #elseif($action == 'decline')
> Â Â ## Decline Invitation <------------------------------------------------------------------------
> @@ -261,7 +264,7 @@
> Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.decline.alreadyReportedAsSpam'){{/error}}
> Â Â #elseif($status != 'pending')
> Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.invalidStatus', ["#messageStatusForCode($status)"]){{/error}}
> - Â Â #elseif($confirm)
> + Â Â #elseif($confirm && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #setMessageStatus($message, 'declined', $memo)##
> Â Â Â $emailContainer.saveAsAuthor($msg.get('xe.invitation.doAction.decline.saveComment'))
> Â Â Â {{info}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.decline.success'){{/info}}
> @@ -280,7 +283,7 @@
> Â Â #if("$!message" == '')
> Â Â Â ## No message found by that id.
> Â Â Â {{error}}(%id="invitation-action-message"%)$msg.get('xe.invitation.doAction.reportSpam.noMessageFound'){{/error}}
> - Â Â #elseif($confirm)
> + Â Â #elseif($confirm && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â #setMessageStatus($message, 'reported', $memo)##
> Â Â Â $emailContainer.saveAsAuthor($msg.get('xe.invitation.doAction.reportSpam.reportSaveComment'))
> Â Â Â ## Your report has been logged, sorry for the inconvienence.
>
> Modified: platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationMemberActions.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationMemberActions.xml    2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/InvitationMemberActions.xml    2010-09-22 01:44:29 UTC (rev 31216)
> @@ -382,7 +382,7 @@
> Â Â Â Â Â Â $msg.get('xe.invitation.doUserActionOnMultipleMessages.cancel.someMessagesNotFound',
> Â Â Â Â Â Â Â Â Â Â Â [$mathtool.sub($messageIDs.size(), $messages.size()), $messageIDs.size()]){{error}})))
> Â Â Â #end
> - Â Â #elseif($confirm)
> + Â Â #elseif($confirm && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â ## If the user accidently selected messages to which this action cannot be done, just skip over them.
> Â Â Â #set($changed = false)
> Â Â Â #foreach($message in $messages)
> @@ -435,7 +435,7 @@
> Â Â Â Â $msg.get('xe.invitation.doUserActionOnMultipleMessages.noMessagesFound')
> Â Â Â #end
> Â Â Â {{/error}})))
> - Â Â #elseif($confirm)
> + Â Â #elseif($confirm && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â Â ## If the user accidently selected messages to which this action cannot be done, just skip over them.
> Â Â Â #set($changed = false)
> Â Â Â #foreach($message in $messages)
>
> Modified: platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/WebHome.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/WebHome.xml    2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/invitation/src/main/resources/Invitation/WebHome.xml    2010-09-22 01:44:29 UTC (rev 31216)
> @@ -737,7 +737,9 @@
> Â Â #set($messageBody = '')
> Â #end
> Â ##
> - Â #if("$!request.get('sendMail')" != '' && $request.getMethod().toLowerCase() == 'post')
> + Â #if("$!request.get('sendMail')" != ''
> + Â Â Â && $request.getMethod().toLowerCase() == 'post'
> + Â Â Â && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â #generateAndSendMail($config,
> Â Â Â Â Â Â Â Â Â Â Â Â Â $recipients,
> Â Â Â Â Â Â Â Â Â Â Â Â Â $subjectLine,
>
> Modified: platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterAdmin.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterAdmin.xml  2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterAdmin.xml  2010-09-22 01:44:29 UTC (rev 31216)
> @@ -281,7 +281,7 @@
> Â #set($msgRestart=$msg.get("xe.officeimporter.openoffice.actions.restart"))
> Â #set($msgUpdate=$msg.get("xe.officeimporter.openoffice.update"))
> Â #set($msgLimitedControl=$msg.get("xe.officeimporter.openoffice.limitedcontrol"))
> -#if($hasAdmin)
> +#if($hasAdmin && ${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â #set($currentAction = "$!{request.action}")
> Â #if($currentAction == "stop")
> Â Â #if(!$oomanager.stopServer())
>
> Modified: platform/xwiki-applications/trunk/panels/src/main/resources/Panels/DocumentInformation.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/panels/src/main/resources/Panels/DocumentInformation.xml  2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/panels/src/main/resources/Panels/DocumentInformation.xml  2010-09-22 01:44:29 UTC (rev 31216)
> @@ -547,7 +547,7 @@
> Â #end
> Â ## Use the syntax and content received from the client, as the user might have made some changes that are not on saved yet.
> Â #set($void = $translatedDoc.setSyntaxId($oldSyntax))
> - Â #if (!$translatedDoc.convertSyntax($newSyntaxId))
> + Â #if (!$translatedDoc.convertSyntax($newSyntaxId) || !${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â Â #set($error = true)
> Â #else
> Â Â #set($void = $translatedDoc.save("Document converted from syntax $oldSyntax to syntax $newSyntaxId"))
>
> Modified: platform/xwiki-applications/trunk/panels/src/main/resources/Panels/PanelLayoutUpdate.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/panels/src/main/resources/Panels/PanelLayoutUpdate.xml   2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/panels/src/main/resources/Panels/PanelLayoutUpdate.xml   2010-09-22 01:44:29 UTC (rev 31216)
> @@ -34,7 +34,7 @@
> Â ##
> Â ## Check to see if the current user has admin rights on the current preferences document.
> Â ##
> -#if(!$xwiki.hasAccessLevel("admin", $xcontext.user, $prefsdocument))
> +#if(!$xwiki.hasAccessLevel("admin", $xcontext.user, $prefsdocument) || !${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> Â #xwikimessageboxstart("$msg.get('panelwizard.placemanager')" "")
> Â $msg.get("panelwizard.notadmininplace", $place)
> Â #xwikimessageboxend()
>
> Modified: platform/xwiki-applications/trunk/wiki-manager/src/main/resources/XWiki/XWikiServerClassSheet.xml
> ===================================================================
> --- platform/xwiki-applications/trunk/wiki-manager/src/main/resources/XWiki/XWikiServerClassSheet.xml  2010-09-22 01:44:21 UTC (rev 31215)
> +++ platform/xwiki-applications/trunk/wiki-manager/src/main/resources/XWiki/XWikiServerClassSheet.xml  2010-09-22 01:44:29 UTC (rev 31216)
> @@ -36,7 +36,9 @@
> Â #set ($wiki = $WikiManager.getWikiFromDocumentName($doc.fullName))
> Â ##
> Â #if ($action && ($action == "create") && $domain && ($domain.trim().length() > 0))
> - Â Â #if (!$wiki.containsWikiAlias($domain))
> + Â Â #if (!${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> + Â Â Â #error($msg.get("notallowed"))
> + Â Â #elseif (!$wiki.containsWikiAlias($domain))
> Â Â Â #set ($alias = $wiki.newObject("XWiki.XWikiServerClass"))
> Â Â Â $alias.set("server", $domain)
> Â Â Â $alias.set("homepage", "Main.WebHome")
> @@ -47,7 +49,9 @@
> Â #end
> Â ##
> Â #if ($action && ($action == "delete") && $domain && ($domain.trim().length() > 0))
> - Â Â #if ($wiki.containsWikiAlias($domain))
> + Â Â #if (!${services.csrf.isTokenValid("$!{request.getParameter('form_token')}")})
> + Â Â Â #error($msg.get("notallowed"))
> + Â Â #elseif ($wiki.containsWikiAlias($domain))
> Â Â Â #set ($alias = $wiki.getWikiAlias($domain))
> Â Â Â #set ($removed = $wiki.removeObject($alias.objectApi))
> Â Â Â $wiki.save()
>
> _______________________________________________
> notifications mailing list
> notifications(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/notifications
>
--
Thomas Mortagne
As planned by the XE 2.5 roadmap
(http://enterprise.xwiki.org/xwiki/bin/view/Main/Roadmap) i would like
to move extension manager to the platform. It's one application for
the UI and one jar for the framework (plus several MB of
maven/classloading dependencies).
The rationale is that it makes it easier to try and play with it to
have as much comments as possible.
It would be "taged" as experimental which means anything in it can be
changed anytime and nobody can expect a code that use this component's
API to not be broken.
The current state of Extension Manager is summarized in
http://dev.xwiki.org/xwiki/bin/view/Design/ExtensionManagerProposal#HPlanni…
and detailed in the rest of the document.
I'm pretty confident it's not dangerous for the rest of XE when you
don't use it and it can't slow down it or something.
So WDYT ?
Here is my +1.
Thanks,
--
Thomas Mortagne
Hello there,
I have been asked to develop something on top of the pdf export facilities
on the xwiki. But I run into a small problem:
When *generating a pdf with multiple pages*, say all the pages from one
space, the ids of elements within the pages get duplicated and the *pdf
exportation fails*.
i.e.:
*Page A* with a title *TheQuickBrownFox...* some text under it and then *page
B* with the same title: *TheQuickBrownFox...* with some other text under
this. Both will get an auto ID of *TheQuickBrownFox...
*Now this doesn't happen for items on the same page since the ID generation
mechanism counts all items of the same name and increments it if necessary.
But this mechanism does not contemplate cross page duplicated items.
To avoid the following error:
Property ID "lipsum" (found on "fo:block") previously used; ID values
must be unique within a document! (See position 12:39)
We thought some changes to the ID generation mechanism could be made:
We could* prefix the ID* with the space and page name and this would
be a simple elegant solution.
Now:
Is this the best solution?
Will someone point out the best place to do this?
If I post a patch with this fix will it be included on the trunk?
Thank you in advance,
» Ricardo EspÃrito Santo
» Linkare TI - Tecnologias de Informação, Lda
Hi devs,
wdyt about committing the section & macro columns from the contrib
(https://svn.xwiki.org/svnroot/xwiki/contrib/projects/xwiki-macro-column/)
in the platform macros, along with a first, very simple implementation
of the dashboard macro (which for the moment only delegates to the
section macro)?
This would be the first step towards the implementation of the
dashboard, and the plan is to be done before 2.5M2.
Here's my +1.
WDYT?
Anca
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