Does anyone have a more extensive Wiki plug-in example?
I'm needing to do an LDAP directory application, and I'm lazy, so I don't
want to do the whole UI. So I figure I can create an LDAP search plug-in
that does:
$results =
$xwiki.ldapsearch.search("ldap://ldap.example.com:389/o=Top??sub?(cn=${text}
)")
Foreach ($result in $results)
$record = $xwiki.ldapsearch.get($result)
{$record.get("cn")}
End
. or something like that - anyhow. The idea is to create a list of names,
phone numbers, etc. that match the search criteria.
Unfortunately, the example "hello world" plug-in does not show off a
collection, so if anyone has any pointers, I'd like to hear them.
Of course, if anyone has already done this, I'd definitely like to hear that
too.
Adrian Hall
Sr. Product Line Manager
Technology Partnerships
ahall(a)mirapoint.com
Ph: (408) 667-4977
MSN: ahall(a)mirapoint.com
Skype: adrianhall
If you can, please help me with this XWiki query. The languages in XWiki
are ALL new to me: Java, SQL, Velocity, Hibernate, etc. The complete page
code is at the end, for reference.
GENERAL APPLICATION GOAL
To dynamically sort XWiki content through navigation by custom "categories"
(slightly similar to XWiki's News/Blog/Articles classification model).
THE PROBLEM
Construct a query for a page where:
- Class name must begin with "XYZ" (e.g., "XYZ.PROClass")
- all ClassTemplates are excluded
- there is a common class property called "category" (which does NOT exist
for ALL "XYZ*" Classes) which is equivalent to the value of a temporary
variable "category1" obtained from the current URL (i.e., getParameter from
a URL Get posted by the previous page)
- results are sortable by standard document properties (and eventually, also
sort by custom Class properties, too)
CURRENT QUERY ATTEMPT
sql=(", BaseObject as obj where obj.name=doc.fullName and obj.className like
'XYZ%' and obj.name not like '%ClassTemplate' and obj.category like
'${category1}' order by '${mrsorter}'");
TROUBLESHOOTING
The present query, upon repeatedly splicing it, is apparently not working
for either of these components:
* obj.category like '${category1}' - returns page error:
"java.lang.ClassCastException"
* order by '${mrsorter}' - returns page error:
"com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while
searching documents with sql ,BaseObject as obj where obj.name=doc.fullName
and obj.className like 'XYZ%' order by 'doc.name' Wrapped Exception: could
not execute query "
ABOUT XYZ* CLASSES & CATEGORY PROPERTY
Right now, in my XWiki there exists one "XYZ*" custom class (as a document
template) which contains a property called "category" among other XYZ*
classes which do not. The goal is to add more classes with names beginning
with "XYZ*" that this query will need to explore in order to find matching
"category" property results. I modeled the category property after the
classification system in XWiki's Blog/ArticleClass, such that:
Name: category
Pretty Name: Category
Unmodifiable: No
Number: 2
Display Type: select
Multiple Select: Yes
Relational Storage: Yes
Size: 5
Hibernate Query: select prop.value from BaseObject as obj, StringProperty as
prop where obj.className='XYZ.Catsv02Class' and prop.id.id = obj.id and
prop.id.name='name'
FYI, XYZ.Catsv02Class exists as the class of all categories for content.
When context= inline, I need a select list of these (similar to editing an
XWiki Article) - but I can't get one to display on the page. But that's
another story ... back to the query!
COMPLETE PAGE CODE
<%
title1=request.getParameter("title");
category1=request.getParameter("category");
if (!title1) {
title1 = "Unspecified"
}
if (!category1) {
category1 = "Unspecified"
}
mrsorter=request.getParameter("orderby");
if(!mrsorter) {
#set ($mrsorter = "doc.name")
mrsorter = xwikidocument.getName();
}
sql=(", BaseObject as obj where obj.name=doc.fullName and obj.className like
'XYZ%' and obj.name <> '%ClassTemplate' and obj.category like '${category1}'
order by '${mrsorter}'");
%>
[XYZ Home>XYZ.nav] : [${title1}>XYZ.subnav] :
1 ${category1} <br>
Sort by:
[Document No.>XYZ.catdoc?category=&orderby=doc.name] /
[Date>XYZ.catdoc?category=&orderby=doc.date] /
[Title>XYZ.catdoc?category=&orderby=doc.title]
[+ Add New>apps.AddNew?category=${category1}]
<%
def formatdate(arg)
{
rd=arg.toString()
a=rd.split(" ");
return a[0]
}
println "1.1 Controlled Documentation";
println "<table border=0 cellpadding=0 cellspacing=12>";
println "<tr> <td>*Title*</td> <td>*Document No.*</td> <td>*Version*</td>
<td>*Released*</td> <td>*<nobr>Previous No.</nobr>*</td> </tr>";
for (item in xwiki.searchDocuments(sql))
{
d=xwiki.getDocument(item)
rd=xwiki.formatDate(d.date,"MM/dd/yyyy")
println
"<tr><td>[${d.title}>${d.fullName}]</td><td><nobr>${d.name}</nobr></td><td>${d.version}</td><td>${rd}</td><td>${d.orig_doc_no}</td>
</tr>";
}
println "</table>";
%>
END PAGE CODE
I would greatly appreciate any assistance you are able to provide.
Thank you,
eBox
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Hi,
I am trying to install XWiki on my company�s intranet for online project management. I am having trouble using Internet Explorer with XWiki. When I login as a user, I can see my name on the top right hand corner and I can also see the all the admin options on the top action bar (I have admin privileges), which means that I have Logged in successfully. But as soon as I click on a link, the page refreshes and I find that I am logged out. All the admin options are gone. This happens for all the links
On further investigation I found that this problem occurs only when I use a url of following type-
http://machineName:8080/xwiki
If I use following url, it works fine
http://localhost:8080/xwiki
I found that a cookie gets created in �C:\Documents and Settings\userName\Cookies� when I use localhost, but there is no cookie for the machineName. So when the application finds that there is no cookie, it thinks that user is not logged in, and shows default pages.
The interesting thing is that it works fine with Firefox/Mozilla. Since most of our users use Internet Explorer, I am trying hard to get it working but till now I have no clue how to fix this problem. I have enabled all the cookies, kept the intranet security at lowest level and bypassed the proxy, still it�s not working. I have also selected �NO� for the preferences �Always authenticate on viewing� and �Always authenticate on editing�.
I tried searching on the internet but it seems no one else has faced this problem earlier. Please suggest a solution.
My environment is �
XWiki 0.9.840
Windows XP SP2
Tomcat 4.1.31
MySQL 4.1.19
JDK 1.5
Looking forward for your help.
Thanks,
Chandra
I have setup a xwiki in my computer. But failed to input Chinese into it. I changed the charset of these 3 files: web.xml xwiki.cfg velocity.properties and changed the default charset of MySql to gb2312 or gbk, I succeeded in writing Chinese into database but when reading Chinese out of MySql there is an error.
UTF-8 couldn't work either, both in reading and writing. Could anyone tell me what to do? Thanks.
All,
I accidentally deleted the default admin privileges on my XWiki
installation. Can someone give me directions on how to fix this?
Thanks In Advance!!
Deven
Hi,
Google just gave the tentative allocation for project. It turns out we
will get 4 projects. I hoped for more put given the 626 students allocated
(this is already 3M$ by Google) and the 105 Open Source organisation
participation, this is kind of normal.
We will have to make some tough choices. The current list I created was:
User Interface (Implement the ergonomic study)
P2P (allow offline usage and P2P XWiki hosting)
AJAX API, Toolbar and Form Editor (it can be one of them or all)
AntiSpam features
JCR backend
Editor Completion
GData backend
We would have to choose 4 and order the last 3 (in case we get additional
projects at the last minute).
Go ahead and give your opinion before tonight since we have to give the
final answer before tomorrow morning pacific time.
Ludovic
Hi all,
I'm trying to set up XWiki 0.9.840 on Tomcat 4.1.31 and MySQL 5.0.12. I've
deployed the WAR, ran the SQL script against my SQL database, and modified
hibernate.cfg.xml to point to my XWiki database. When I ran the main URL I
got the following errors:
javax.servlet.ServletException: Error number 3 in 0: Could not
initialize main XWiki context
Wrapped Exception: Error number 3201 in 3: Exception while saving
document XWiki.XWikiPreferences
Wrapped Exception: Error number 3221 in 3: Exception while saving
class XWiki.XWikiPreferences
Wrapped Exception: Error number 3222 in 3: Exception while saving
class XWiki.XWikiPreferences
Wrapped Exception: Could not execute JDBC batch update
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127)
Any ideas what might be wrong here?
Apppreciate any suggestions! Thanks!
Hello,
I'd like to know how can I create a new tag to provide a specific text format
such as {mytag} ?
In fact, I'd like to propose a {system} tag that format text with Courier New
font.
Regards
--
Xavier MOGHRABI - Consortium ObjectWeb
Jabber: moghrabi(a)jabber.objectweb.org - Phone: +33 4 76 61 52 35
There have been a number of questions about renaming documents in XWiki,
and the usual answer has been that you can't.
There is, however, a method,
com.xpn.xwiki.doc.XWikiDocument.rename(String, XWikiContext) that
purports to do exactly this, and from the source, it looks like it does
the correct stuff, cloning itself, updating any objects it contains to
refer to the new document name, etc.
The only problem with this method is that, in my case, I haven't been
able to make it work. In one case, it returned, as advertised, a
Document with the new name to my page, but the document remained intact
under its original name and not under the new one. Since that time,
after which I restarted the server, it only returns null. Due to
problems with CGLIB-generated class files, I can't set a breakpoint to
find out why (anyone know the magic to make CGLIB create line-number
entries?).
A few details: the actual problem I'm trying to solve is scripting the
change of existing login IDs to integrate with an enterprise-wide
authentication service, which requires a company-standard naming scheme.
My change to the security scheme was limited to subclassing
XWikiAuthServiceImpl and overriding only the default constructor (to
instantiate the auth service client library) and the checkPassword
method. Since XWiki's default implementation of a user ID is the user's
profile, named XWiki.<username>, that will entail changing a document
name and all wiki references to it. My first plan was a transitional
scheme that involved using XWiki.copyDocument() to create the new
document, leaving the original document in place for the default
XWikiAuthServiceImpl to use, replacing its content with a notice of the
change and removing the user's edit right, then removing it and changing
all wiki references to it the first time they log in under the new
scheme. Alternatively, using XWiki.createUser to create the new user
was a possibility, but it looks messier from the standpoint of migrating
the original user's profile page.
So, a couple of questions, for discussion and/or authoritative answer:
- Does XWikiDocument.rename() actually work as advertised? I am aware
of the need for the "programming" right on the original document to use
the necessary methods (on the space or the wiki doesn't do it), and have
made sure that I have them by checking with checkProgrammingRights.
- What's the best way to change an existing user's login ID without
disruption beyond having to use the new name?
- XWiki provides reasonable ways to find all of the kinds of document
references that I can think of, including object string
fields(especially group membership and rights objects) and wiki links;
are there any others I will need to consider?
- Does the XWikiAdmin identity (or the XWikiAdminGroup, for that
matter) have any implementation outside the database? I notice that
XWikiAdmin's profile document is not named XWikiAdmin, so something is
not the same about it. The reason I need to know is that it won't work
under the new authentication service's naming rules, and I want to
eliminate it for other reasons too (mostly that it's a shared ID) and
replace all of its rights entries with a group entry for
XWikiAdminGroup. Primarily, I need to know whether there's any reason
this strategy won't work, because re-implementing it would constitute an
access backdoor.
Brian M. Thomas - Senior Technical Architect
AT&T Services, Inc.
One SBC Center, Room 24D3
St. Louis, MO 63101
314 235 3141
Hi,
just recently join the list. I wonder if anyone have
specification/implementation plan written for xwiki.
I am thinking alone lines of:
1. quick overview of what wikis are: few lines
2. Wiki business benefits
3. What kind of open source wikis available and what do they offer
4. Why xwiki is special
5. xwiki software model. : how the layers are arranged
6. Extensibility of xwiki. Future of xwiki etc
7. Brief outline of wiki structure for software development shop
8 How to handle ongoing maintenance and care
thanks
rukka