With RC1 lucene seems to work again, so i have costumized the existing search
form from jkraemer
(http://www.jkraemer.net/static/maven/xwiki/plugins/lucene-plugin/install.ht…)
But keep attention: it's just a quick&dirty example to display the results
in a table ;-)
As im not very familiar with velocity, the code is quite ugly! (for example
i didn't find a while loop to output the number of stars for score-quality,
so i did it with if, if, if..)
it still has some bugs:
* if you search for a regular expression (e.g. win*), then the query for the
next page will be win</strong>
* non wiki-documents and non-attachments will be hidden from the results, so
it could happen that you see an empty page with a link to the next results
(that's because searchresults.hitcount returns all results, also the hidden
ones..)
* many more..
* icons are hard-coded.. (/skins/lgs/*.png)
You can get the icons for free from famfamfam:
http://www.famfamfam.com/lab/icons/silk/
---------------------------
Searchform.vm:
1 Search
#set($query = $request.getParameter("text"))
#if(!$query)
#set($query = "")
#end
#warning("This is the new lucene search engine.\\
If you experience any problems, try to use the default xwiki
[Search>WebSearch?text=$query]..")
#set($itemsPerPage = "30")
#set($doRebuild = $request.getParameter("rebuild"))
#if($doRebuild=="yes")
#set($lucene = $xwiki.getPlugin("lucene"))
#if($lucene)
#set($documentCount = $lucene.rebuildIndex($xwiki,$context))
#if(${documentCount}>=0)
Started index rebuild with $documentCount documents. Will take some time
depending on the number of pages/attachments.
#else
Index rebuild failed.
#end
#end
#else
#if($xwiki.hasAdminRights())
[rebuild Index>${doc.web}.${doc.name}?rebuild=yes]
#end
#end
{pre}
<form action="$doc.name" method="post">
<input type="text" name="text" value="$query" />
<input type="submit" value="Search"/>
</form>
{/pre}
#if($query != "")
#set($lucene = $xwiki.getPlugin("lucene"))
#if($lucene)
#set($wikinames = "xwiki")
#set($languages = "default,en,de")
#set($firstIndex = $request.getParameter("firstIndex"))
#if(!$firstIndex)
#set($firstIndex = "1")
#end
#set($searchresults = $lucene.getSearchResults($query, $wikinames,
$languages, $xwiki))
#set($results = $searchresults.getResults($firstIndex,$itemsPerPage))
#if($results.size()>0)
#set($lastIndex=$searchresults.getEndIndex($firstIndex, $itemsPerPage))
#if($searchresults.hitcount==1)
##{pre} $msg.get("oneresult"):{/pre}
#else
##{pre}$msg.get("results") $firstIndex - $lastIndex $msg.get("of")
${searchresults.hitcount}:{/pre}
#if($searchresults.hasPrevious($firstIndex))
[previous
page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getPreviousIndex($firstIndex,$itemsPerPage)]
#end
#if($searchresults.hasNext($firstIndex,$itemsPerPage))
[next
page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getNextIndex($firstIndex,$itemsPerPage)]
#end
#end
<table width="100%" class="grid" cellSpacing=0 cellpadding="5" border="1">
<tr>
<th>Result</th>
<th width="100">Date</th>
<th width="150">Last Author</th>
<th width="100">Score</th>
</tr>
#foreach($result in $results)
#if($result.type=='wikipage')
<tr>
#if($xwiki.isVirtual())
<td align=left>[${result.wiki}:${result.web}.${result.name}]</td>
#else
<td align=left>[${result.web}.${result.name}]</td>
#end
<td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td>
<td>$xwiki.getUserName($result.author)</td>
<td>
#set($resval=$result.score*100)
#if($resval>10)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>25)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>50)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>70)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>90)
/xwiki/skins/lgs/16-star-hot.png
#end
${resval}%
</td>
</tr>
#elseif($result.type=='attachment')
<tr>
<td align=left> ${result.url} /xwiki/skins/lgs/disk.png
${result.filename} \\
Attachment of [${result.web}.${result.name}]</td>
<td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td>
<td>$xwiki.getUserName($result.author)</td>
<td>
#set($resval=$result.score*100)
#if($resval>10)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>25)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>50)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>70)
/xwiki/skins/lgs/16-star-hot.png
#end
#if($resval>90)
/xwiki/skins/lgs/16-star-hot.png
#end
${resval}%
</td>
</tr>
#end
</tr>
#end
#else
$msg.get("noresults")
#end
</table>
\\
#else
lucene plugin not found
#end
#end
--
View this message in context: http://www.nabble.com/Costumized-Lucene-Search-Page-tf3605463.html#a10073014
Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi all,
In user/impl/xwiki/XWikiAuthServiceImpl.java i read:
protected String findUser(String susername2, XWikiContext context)
throws XWikiException {
String susername = susername2.replaceAll(" ", "");
susername = susername.replaceAll(" ", "");
[...]
Why are we calling replaceAll method called twice ? It seems useless,
what have I missed ?
Thanks,
Pablo
Hello xwiki developpers
Imagine you had to powerful applications.
First xwiki, then discourse engine for deliberative decision making.
Lets call the latter 'dito'.
Imagine how nice it would be,
1: if these two applications could use the same authentication, and if
2: signing into one aplication would sign you into the second, too.
3: registering a new account in dito would add a new user to xwiki with
the appropriate rights (edit) without admin interaction (explicitly
setting rights) needed
@1: Done!
Fortunately, as far as *authentication* is concerned, xwiki makes a
geeks life easier, as it provides a XWikiAuthService interface.
Which I implemented for my needs and which works fine.
@2: Hm, solve 3 first
@3: Stuck!
Unfortunately, as far as *authorisation* is concerned, I did not yet get
the point.
My approach is to make an xml-rpc, that logs into the wiki (with a user
that i added manually and that has admin rights) and calls the
XWiki.createUser() method.
In order to achieve that, i extended the ConfluenceRpcHandler and added
a method createUserFromExternal
Suddenly, I get an error in Xwiki, approx. line 2570(i.e. methods
system.out.println("xwiki create user :
!context.getUtil().match"+xwikiname);returns -4 :)
try {
if (!context
.getUtil()
.match(
this.Param(
"xwiki.validusername", "/^[a-zA-Z0-9_]+$/"),
xwikiname))
{
return -4;
}
}
As i am calling from external, the context object (and the request, it
is carrying) are not as complete as they are, when i register via the
xwiki web page.
My questions are:
- is it a good idea to do xwiki user registration automatically and from
external *that* way? do you know alternatives?
- is there an implementation of the mehtod:
/**
* {@inheritDoc}
* @see ConfluenceRpcInterface#addUser(String, java.util.Map, String)
*/
public void addUser(String token, Map user, String password) throws
XWikiException {
throw new XWikiException(XWikiException.MODULE_XWIKI_XMLRPC,
XWikiException.ERROR_XWIKI_NOT_IMPLEMENTED, "Not implemented");
}
?
- If you integrate xwiki into other environments or vice versa, what is
the best practice to wire the two different registration and login
processes of both, xwiki and some_app ?
Of course, i searched the archives, but no solution for this so far...
Any hints?
Best regards
Thomas K.
--
ontopica
Thomas Krämer
Krämer&Okpue GbR
Kurfürstenstr. 66
53115 Bonn
Fon 0228 - 180 99 737
Fax 0228 - 242 78 60
Email tk(a)ontopica.de
Hi,
I'd like to propose setting up the JIRA Calendar plugin (http://
confluence.atlassian.com/display/JIRAEXT/JIRA+Calendar+Plugin) so
that we can show the release dates of the different versions as
planned. Currently these dates are only visible in the JIRA admin
section and on http://www.xwiki.org/xwiki/bin/view/Main/Roadmap but
it's a pain to maintain that page.
In this manner we can make it visible and ensure we are all aligned
on those dates.
WDYT?
Thanks
-Vincent
PS: I don't have admin access to JIRA so we might have to wait till
Raffaello is back from holidays at the end of next week.
The XWiki development team team is pleased to announce the
availability of the 1.0 RC 1 release.
Go grab it on http://www.xwiki.org/xwiki/bin/view/Main/Download
This release is planned to the last before the final 1.0 release
(unless we find some important bugs in which case there'll be a RC2
release). The 1.0 release is still planned for end of April.
New in this release:
* Lots of bugs fixed
* Updated French translation
* New translation: Simplified Chinese and Russian
* Search is now case insensitive in the default Wiki for all
DBMS (it was working fine for MySQL previously)
* Ability to navigate backlinks documents on the Rename page
* Lucene plugin is now working
* Fixed #skype macro which is now using Skype's Presence Service
(was previously using jyve.com which is not working anymore)
* New #pagedViewLinks macro that displays links to the first,
previous, next and last pages in a paged view
* Lots of Macros have been documented on the Macro page in the
Code Zone
* Non ASCII chars can now be used in document names and
attachments (This requires correct encoding configuration)
* Superadmin is set to use the Advanced editing mode by default
(was in Simple mode)
* {style} macro now supports border and icon attributes
* Added support for Oracle
See the full release notes on http://www.xwiki.org/xwiki/bin/view/
Main/ReleaseNotesXWiki10RC1
Enjoy
-The XWiki development team
Hi,
I've installed a XWiki in a Tomcat with a external database (MySQL). I want
to use xwiki-beta3 release, but i've only found a beta-1 Script for MySQL
(xwiki-mysql-1.0-beta-1.sql). Has someone know where i could found a MySQL
script for xwiki-beta3 release??
Thanks,
meni.-
--
View this message in context: http://www.nabble.com/MySQL-Script-for-xwiki-beta3-release-tf3601210.html#a…
Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi everyone,
I've staged the RC1 release on http://www.xwiki.org/10rc1/
It would be nice if some of you could quickly try it out and let us
know if it's working as expected. Once we get a few confirmations
we'll officially release it.
Thanks a lot
-Vincent (on behalf of the XWiki dev team)
Hi all,
For a particular project, I have a plugin that reads data from an
external database using some JDBC queries.
For each row of my JDBC ResultSet, the plugin creates an XWiki document,
the associated objects, and fill these objects.
All is running fine except that I have around 50.000 objects to import :-D.
Then I get a Java Heap Space exception.
I re-re-re-re-re-read my source code, I don't keep any reference to the
documents created.
Every 200 document creation, I do the following calls :
context.getWiki().flushCache();
context.getWiki().getStore().cleanUp(context);
System.gc();
Anyway, the amount of memory used doesn't go down after flushing the caches.
And I still get my Heap Space exception.
Does anybody has an idea for me ?
Who thinks that I could be a XWiki memory leak ?
Thanks,
--
Arnaud Thimel
Société Code Lutin - http://www.codelutin.com
Hi committers,
We've already discussed this before but I've seen that we're not all
following this (even though we agreed to do it on this list).
I have now put it in http://www.xwiki.org/xwiki/bin/view/Community/
DevelopmentPractices#HApplyingacontributor27spatch
The idea is to give proper recognition to contributors by:
1) Naming them using the specified commit log template
2) Adding them on the contributor's page on xwiki.org
It would be nice if all committers could follow this and help each
other follow it (I know I'm also forgetting it from time to time).
Thanks
-Vincent