Re: [xwiki-devs] How to use WikiWords?
I still can't figure out how to use WikiWords. I have searched with Google on "XWiki +WikiWords", but nothing relevant came up. I have searched the XWiki-site for documentation on how to use WikiWords, but can't find any docs. Does anyone have a clue for me? Thanks! -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-WikiWords-tp7070568p7077791.htm... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Hamster, On Dec 9, 2011, at 12:02 PM, Hamster wrote:
I still can't figure out how to use WikiWords. I have searched with Google on "XWiki +WikiWords", but nothing relevant came up.
I have searched the XWiki-site for documentation on how to use WikiWords, but can't find any docs.
Does anyone have a clue for me?
See http://extensions.xwiki.org/xwiki/bin/view/Extension/WikiWord+Transformation (I've just added it, was missing) Thanks -Vincent
Thanks!
Hi Vincent, Thanks! I modified the xwiki.properties and now WikiWords are working! Are there any reasons (performance-hit for example) why WikiWords are disabled by default? Or is it just a matter of preference? Cheers, Hamster -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-WikiWords-tp7070568p7078288.htm... Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Dec 9, 2011, at 3:06 PM, Hamster wrote:
Hi Vincent,
Thanks! I modified the xwiki.properties and now WikiWords are working!
Are there any reasons (performance-hit for example) why WikiWords are disabled by default? Or is it just a matter of preference?
Both :) I've added a section about performances on http://extensions.xwiki.org/xwiki/bin/view/Extension/WikiWord+Transformation Thanks -Vincent
Cheers,
Hamster
Hi Vincent, Just thinking out loud about the performance-hit when WikiWords are enabled... I guess that there's performance-hit because the pages are processed each time a user opens that page, right? If so, maybe we should use a different mechanisme for the WikiWords? There are two cases when WikiWords should be processed: (1) When a user edits a page and adds a WikiWord to that page, and (2) when a user adds a new page to the Wiki (all other pages should be updated). If we have a "database" of all WikiWords in the Wiki, we would know up-font which pages we need to update. In both cases, the WikiWords are processed only once, and further performance-hits should not occur(???) WDYT? -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-WikiWords-tp7070568p7085346.htm... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi, On Dec 12, 2011, at 9:16 AM, Hamster wrote:
Hi Vincent,
Just thinking out loud about the performance-hit when WikiWords are enabled...
I guess that there's performance-hit because the pages are processed each time a user opens that page, right?
If so, maybe we should use a different mechanisme for the WikiWords? There are two cases when WikiWords should be processed: (1) When a user edits a page and adds a WikiWord to that page, and (2) when a user adds a new page to the Wiki (all other pages should be updated). If we have a "database" of all WikiWords in the Wiki, we would know up-font which pages we need to update.
In both cases, the WikiWords are processed only once, and further performance-hits should not occur(???)
Yes you're completely right. Actually I code the WikiWord Rendering Transformation as an exercise just to prove that it worked and as a stop gap solution to offer this feature quickly. You're right that a better solution would be what you describe. However the problem still remains that you'll need to map the "table of links" to the document content being rendered. Imagine for example that for document X the table returns 2 links called A and B. When the rendering engin renders the content as HML (for ex), our code would need to extend/override the onWord() event and compare it to A and B to see if they match. So the performance gain will be the different between a contains() in a List (for checking if it matches A and B) vs the time to do a regex match with a compiled pattern. I have the feeling the regex match could actually be faster or very similar since if it's implemented correctly it'll check the first letter and return if they don't match and if it's not an uppercase letter, then check the second letter, etc. WDYT? Thanks -Vincent
WDYT?
BTW I forgot to comment that we currently cache the XDOM but it's cached before transformations are executed. We could improve this and define the notion of cacheable transformations vs non-cacheable transformations. For example Macros would be non-cacheable transformations (since they contain script and you need dynamism) but WikiMacros transformation is a cacheable transformation. Thanks -Vincent On Dec 12, 2011, at 9:59 AM, Vincent Massol wrote:
Hi,
On Dec 12, 2011, at 9:16 AM, Hamster wrote:
Hi Vincent,
Just thinking out loud about the performance-hit when WikiWords are enabled...
I guess that there's performance-hit because the pages are processed each time a user opens that page, right?
If so, maybe we should use a different mechanisme for the WikiWords? There are two cases when WikiWords should be processed: (1) When a user edits a page and adds a WikiWord to that page, and (2) when a user adds a new page to the Wiki (all other pages should be updated). If we have a "database" of all WikiWords in the Wiki, we would know up-font which pages we need to update.
In both cases, the WikiWords are processed only once, and further performance-hits should not occur(???)
Yes you're completely right.
Actually I code the WikiWord Rendering Transformation as an exercise just to prove that it worked and as a stop gap solution to offer this feature quickly.
You're right that a better solution would be what you describe. However the problem still remains that you'll need to map the "table of links" to the document content being rendered. Imagine for example that for document X the table returns 2 links called A and B. When the rendering engin renders the content as HML (for ex), our code would need to extend/override the onWord() event and compare it to A and B to see if they match.
So the performance gain will be the different between a contains() in a List (for checking if it matches A and B) vs the time to do a regex match with a compiled pattern.
I have the feeling the regex match could actually be faster or very similar since if it's implemented correctly it'll check the first letter and return if they don't match and if it's not an uppercase letter, then check the second letter, etc.
WDYT?
Thanks -Vincent
WDYT?
I have enabled WikiWords, but there's something strange going on (in my opinion). I have created a Space called "Engineering". In this space I create a Page called "GeneralMotors". (...xwiki/bin/view/Engineering/GeneralMotors) In another space, called "Sales", I created a page called "OurProducts" where I put the WikiWords "GeneralMotors". XWiki does not recognize the existing GeneralMotors page in the "Engineering Space", it want's to create a Wiki Page "GeneralMotors" in the "Sales Space"! I don't think that this should be happening, the WikiWord should refer to the existing page "GeneralMotors" in the "Engineering Space"! Have I done something wrong? Are WikiWords "restricted" to the Space where they are created? Do sub-pages influence WikiWords in any way? -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-WikiWords-tp7070568p7111079.htm... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Hamster, On Dec 20, 2011, at 9:30 AM, Hamster wrote:
I have enabled WikiWords, but there's something strange going on (in my opinion).
I have created a Space called "Engineering". In this space I create a Page called "GeneralMotors". (...xwiki/bin/view/Engineering/GeneralMotors) In another space, called "Sales", I created a page called "OurProducts" where I put the WikiWords "GeneralMotors". XWiki does not recognize the existing GeneralMotors page in the "Engineering Space", it want's to create a Wiki Page "GeneralMotors" in the "Sales Space"!
I don't think that this should be happening, the WikiWord should refer to the existing page "GeneralMotors" in the "Engineering Space"!
Have I done something wrong? Are WikiWords "restricted" to the Space where they are created? Do sub-pages influence WikiWords in any way?
Indeed this is a current limitation. When a wikiword is recognized the link that is automatically created points to the current space. There's no searching in the whole wiki for links that would exist with the same name. That would be possible to do based on the backlinks that we store in the DB but there would be a few issues: * It would slow down the wikiword feature a lot, unless we store all links in memory * We would need somehow to handle the case where there are several pages named the same but in different spaces You could open a jira issue about this if you want. ATM if you need to reference a page in another space you'll need to use the wiki syntax for it, i.e. [[OtherSpace.<WikiWord>]] (in XWiki Syntax 2.0+). Thanks -Vincent
vmassol wrote
Indeed this is a current limitation. When a wikiword is recognized the link that is automatically created points to the current space. There's no searching in the whole wiki for links that would exist with the same name.
Hi Vincent, That's a serious limitation. I can see my users creating the 'same' Wiki page in different spaces, each page holding different information. That will be a nightmare to administer! There's no flag in XWiki which forces "Uniquely Named Wiki Pages", so that a WikiPage must have a unique name throughout the entire XWiki (regardless in which space the wiki-page has been created)? Using the XWiki Syntax to point to the correct Wiki Page undermines the power of WikiWords. The user must know in which space the wiki-page has been created. The power of WikiWords is that the user should NOT know where the page is located, the WikiWords does all the redirecting for the user. I will open a jira issue, I bet there are more users which want to use WikiWords like this. Thanks, Hamster -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-use-WikiWords-tp7070568p7111357.htm... Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Dec 20, 2011, at 11:44 AM, Hamster wrote:
vmassol wrote
Indeed this is a current limitation. When a wikiword is recognized the link that is automatically created points to the current space. There's no searching in the whole wiki for links that would exist with the same name.
Hi Vincent,
That's a serious limitation. I can see my users creating the 'same' Wiki page in different spaces, each page holding different information. That will be a nightmare to administer!
There's no flag in XWiki which forces "Uniquely Named Wiki Pages", so that a WikiPage must have a unique name throughout the entire XWiki (regardless in which space the wiki-page has been created)?
Using the XWiki Syntax to point to the correct Wiki Page undermines the power of WikiWords. The user must know in which space the wiki-page has been created. The power of WikiWords is that the user should NOT know where the page is located, the WikiWords does all the redirecting for the user.
I will open a jira issue, I bet there are more users which want to use WikiWords like this.
Actually I'm not sure if there are users using the wikiword feature out there. This feature hasn't been requested much. Personally I only wrote it mostly to demonstrate the Rendering Transformation feature and not because this was a feature often requested. I'm all for improving it though. Thanks -Vincent PS: BTW you should post to the users list and not the developers list for this. This would have also allowed other users to chime in and tell us if they use this feature⦠:)
On 12/20/2011 05:44 AM, Hamster wrote:
vmassol wrote
Indeed this is a current limitation. When a wikiword is recognized the link that is automatically created points to the current space. There's no searching in the whole wiki for links that would exist with the same name.
Hi Vincent,
That's a serious limitation. I can see my users creating the 'same' Wiki page in different spaces, each page holding different information. That will be a nightmare to administer!
There's no flag in XWiki which forces "Uniquely Named Wiki Pages", so that a WikiPage must have a unique name throughout the entire XWiki (regardless in which space the wiki-page has been created)?
Using the XWiki Syntax to point to the correct Wiki Page undermines the power of WikiWords. The user must know in which space the wiki-page has been created. The power of WikiWords is that the user should NOT know where the page is located, the WikiWords does all the redirecting for the user.
I will open a jira issue, I bet there are more users which want to use WikiWords like this.
Well, spaces are created exactly so that multiple documents with the same name can exist with different purposes in different spaces. They totally separate documents into distinct "places". If a document wishes to reference a document from another space, then it must explicitly mention the other space. At least this is the way spaces behave in the original philosophy of XWiki. What you're trying to achieve looks more like a flat list of documents with tags separating them into different categories. One alternative that would work right away is to use only one space for holding documents, and use tags to separate them into pseudo-spaces. This means that you'll lose many other advantages of real spaces, like distinct access rights for each space, per-space statistics, a clear separation of documents... And you'll probably have to work a bit to get an equivalent space dashboard that works based on tags, not on the containing space of documents. Anyway, a setting that would allow to enforce unique cross-space names would be a useful feature, so feel free to make a feature request for that. -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Hamster -
Sergiu Dumitriu -
Vincent Massol