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
I noticed that someone said that there would be a fix for this in a future release, but is there a workaround for this? I am getting these same exceptions on two different machines with different MySQL/Tomcat versions.
Exceptions:
>an assertion failure occured (this may indicate a bug in Hibernate, but is more >likely due to unsafe use of the session)
>org.hibernate.AssertionFailure: possible nonthreadsafe access to session
Thank you,
Tim Dove
Hello again,
I need in my wiki this configuration
xwiki level: everything is restricted to admins
namespace X: everyone (connected or not) has read access.
Problem:
If i put nothing at namespace X level, nobody except admins can read
documents
If i define read access at namespace X level, i need to know what i
have to put in user/group to define 'anyone'
You could of course tell me to use a combo of guest and
XWiki.XWikiAllGroup, but unfortunately, our user are not created using
the registration interface. They are mapped to an ldap server. So the
XWiki.XWikiAllGroup stays empty. Unless, of course, this is a virtual
group which says always true when asked if xyz belong to it. But it
doubt it's virtual :)
So, what are suggestions about this?
regards,
Tchize
Hi,
It worked for me also, many thanks Robin.
I just had to correct something in the code, in the link: instead of
"viewrev" as action I replaced with "view" because action viewrev was
not understood in my wiki (0.9.840).
Jeremie
> -----Original Message-----
> From: yoavshapira(a)gmail.com [mailto:yoavshapira@gmail.com] On
> Behalf Of Yoav Shapira
> Sent: mardi 16 mai 2006 15:07
> To: robin(a)soal.org; xwiki-users(a)objectweb.org
> Subject: Re: [xwiki-users] RSS feed for an individual page?
>
> Robin,
> That seems to work very well! Thanks again ;)
>
> Yoav
>
> On 5/13/06, Yoav Shapira <yoavs(a)computer.org> wrote:
> > Robin,
> > This sounds promising -- I will try it out on Monday. Thanks!
> >
> > Yoav
> >
> > On 5/13/06, Robin Fernandes <rewbs.soal(a)gmail.com> wrote:
> > > Hi,
> > >
> > > I don't think there's a per page RSS feed available by
> default, but
> > > you could create one quite easily by doing something like this:
> > >
> > > 1. Go to the class editor and edit the skin object 2.
> Create a new
> > > TextArea property with the name "pagefeed.vm"
> > > 3. Go to your skin and edit objects. Select the skin object and
> > > scroll to the pagefeed.vm testbox.
> > > 4. Paste in this code, or similar (I haven't tested it
> extensively):
> > > http://openmpt.xwiki.com/xwiki/bin/view/XWiki/PageFeed?xpage=code
> > > 5. Save
> > >
> > > We have just created a new template that generates an
> Atom feed for
> > > the revision history of a document. So if we view a page
> with this
> > > template, instead of having the document displayed in the
> standard
> > > web page layout, we'll get its Atom feed.
> > >
> > > To use the template, simply set xpage=pagefeed on the
> query string.
> > > So you'll get a URL like this (click to see corresponding feed):
> > >
> http://openmpt.xwiki.com/xwiki/bin/view/Main/WebHome?xpage=pagefeed
> > >
> > > 6. You could now modify your sidebar to include a link to the
> > > current page's RSS feed like:
> > > Feed for this Page: <a href="$!tdoc.getExternalURL("Main.WebRss",
> > > "view", "xpage=pagefeed")"><img
> src="$xwiki.getSkinFile("rss.gif")"
> > > border="0" alt="Atom feed for this page" /></a>
> > >
> > > Is this suitable?
> > > Note: I'm not sure how well this will scale.
> > >
> > > Regards,
> > > Robin
> > >
> > > On 11/05/06, Yoav Shapira <yoavs(a)computer.org> wrote:
> > > > Hi,
> > > > Newbie user here, I apologize in advance if my question is an
> > > > obvious FAQ. I tried to research it myself with no luck. My
> > > > question is
> > > > simple: where can I find the changes feed for an
> individual wiki page?
> > > >
> > > > I installed XWiki, everything is working fine,
> including the feed
> > > > for all the changes which I access via the little RSS button in
> > > > the bottom-right corner, which points to
> > > > http://localhost:8080/xwiki/bin/view/Main/WebRss?xpage=rdf. So
> > > > far, so good. But my individual wiki pages don't seem
> to have this button.
> > > > Am I just missing something obvious?
> > > >
> > > > Thank you,
> > > >
> > > > Yoav Shapira
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > You receive this message as a subscriber of the
> xwiki-users(a)objectweb.org mailing list.
> > > > To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> > > > For general help: mailto:sympa@objectweb.org?subject=help
> > > > ObjectWeb mailing lists service home page:
> > > > http://www.objectweb.org/wws
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > You receive this message as a subscriber of the
> xwiki-users(a)objectweb.org mailing list.
> > > To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> > > For general help: mailto:sympa@objectweb.org?subject=help
> > > ObjectWeb mailing lists service home page:
> > > http://www.objectweb.org/wws
> > >
> > >
> > >
> >
> >
> > --
> > Yoav Shapira
> > Nimalex LLC
> > 1 Mifflin Place, Suite 310
> > Cambridge, MA, USA
> > yoavs(a)computer.org / www.yoavshapira.com
> >
>
>
> --
> Yoav Shapira
> Nimalex LLC
> 1 Mifflin Place, Suite 310
> Cambridge, MA, USA
> yoavs(a)computer.org / www.yoavshapira.com
>
>
Hi,
Newbie user here, I apologize in advance if my question is an obvious
FAQ. I tried to research it myself with no luck. My question is
simple: where can I find the changes feed for an individual wiki page?
I installed XWiki, everything is working fine, including the feed for
all the changes which I access via the little RSS button in the
bottom-right corner, which points to
http://localhost:8080/xwiki/bin/view/Main/WebRss?xpage=rdf. So far,
so good. But my individual wiki pages don't seem to have this button.
Am I just missing something obvious?
Thank you,
Yoav Shapira
Hello,
Are you sure that user name as it appears in user admin page
(Xwiki.XWikiUsers) is exactly the same as in group admin page ??
(Xwiki.XWikiAdminGroup)
I don't think names with ':' are suitable name.
For instance in my wiki the names are of this form: 'XWiki.jbousque' in
groups users list.
> -----Original Message-----
> From: Tchize [mailto:tchize@myrealbox.com]
> Sent: mardi 16 mai 2006 10:55
> To: xwiki-users(a)objectweb.org
> Subject: [xwiki-users] assigning users to groups does not work?
>
> Hello,
>
> am trying to assign user to a group.
> I go in the web interface and add a user. I go to
> /xwiki/bin/view/XWiki/XWikiAdminGroup and click on 'edit
> table'. The interface then shows this when i query the group:
>
> Group members
> Member
> xwiki:delbd
> XWiki.delbd
> xwiki:XWiki.delbd
> delbd
>
>
>
> However, if i log with this user, he doesn't appear to be
> part of the groups, he doesn't have the rights associated
> with the group.
>
> I did a step by step run of xwiki code in eclipse in
> XWikiRightServiceImpl and i found in line 300 that Collection
> glist = groupService.listGroupsForUser(name, context); return
> an empty list for user 'delbd'
>
> What is the problem? Did i fail in some way?
>
>
Hello,
am trying to assign user to a group.
I go in the web interface and add a user. I go to
/xwiki/bin/view/XWiki/XWikiAdminGroup and click on 'edit table'. The
interface then shows this when i query the group:
Group members
Member
xwiki:delbd
XWiki.delbd
xwiki:XWiki.delbd
delbd
However, if i log with this user, he doesn't appear to be part of the
groups, he doesn't have the rights associated with the group.
I did a step by step run of xwiki code in eclipse in
XWikiRightServiceImpl and i found in line 300 that
Collection glist = groupService.listGroupsForUser(name, context);
return an empty list for user 'delbd'
What is the problem? Did i fail in some way?
Hello everyone
Is there a possibility of listing all the connected users from a
Velocity script?
I looked in the source code and I did not find any method that can do
something like that from the context or xwiki objects.
Thanks
Diana
I wonder if anyone has used xwiki to publish structured data like a research paper. There are multiple sections and some metadada for each paper. I would like to input these sections and metadata in different fields so that they can be searched by individual section or metadata field later. In addition, I want to save each paper in XML format as well. What are the possible ways to implement these new functions?
Thanks,
AJ
I've read some of the archives, and this list looks pretty friendly.
I'd be grateful for some help. I've been running XWiki for about two
weeks and plan to use it for work. The PDF and RSS features are
outstanding! I've also spend a lot of time looking at the xwiki.org
site and the FAQs on xwiki.com, looking for answers and finding some
good ones
Now the list of questions:
Skins
I'd really like to change the look of the site. There's an FAQ for
creating skins, but I can only see it in French. Unfortunately, I
don't read French. Is there an English language version?
I did manage to get Google to try to translate the document, but it
wasn't really readable.
Comments preferences
I found the FAQ on reversing comments order. Either I missed something,
or it wasn't clear whether I was supposed to directly edit comments2.vm
in the templates dir, or paste the contents of the file into the
"Comments" area for the default skin. So I did the pasting and modified
the code there with good results. So it appears that if your current
skin object doesn't have anything defined for a particular property, it
defaults to the file in the templates directory. Is this true? Next
question is about preferences. Looking deeper at the code for
comments2.vm, there are calls to $xwiki.getWebPreference to retrieve
values for "showcomments" and "commentsorder". Where and how are these
preference values defined? I search xwiki.org, the FAQ, and Googled,
with no luck.
Email registration verification
Okay, I found the setting for using email verification of registrations
by going to XWiki preference, registration. Do these settings do
anything yet? I tried turning them on, but it doesn't appear to change
anything about the registration process. I'm on 0.9.840.
I have many more questions, but that's probably too many already.
Thanks in advance,
</CR>
--
Chris Rigsby
Systems Architect, Enterprise Application Systems
University of Minnesota
rigsb007(a)umn.edu * 612/624-5334
Has anyone got a method for searching PDF attachments (and/or other
attachment types) that have been stored alongside documents?
I have the following search SQL:
#set($sql= ", XWikiAttachment attach, XWikiAttachmentContent as attachc
where doc.web = 'KB.AnalystDocs' and doc.id = attach.docId and attach.id =
attachc.id and attachc.content like '%$text%' order by doc.name")
in my WebSearch page. Unfortunately, that doesn't decode the content, which
I would like to do.
Any pointers on how to do this would be gratefully received.
(Perhaps altering the upload code that that when it stores it, it tries to
do a to text translation using plug-in types?)
-Adrian
--
Adrian Hall
Sr. Product Line Manager, Administration and Identity Management
e. ahall(a)mirapoint.com; t. +1 (408) 720-3856; c. +1 (408) 667-4977
Thanks for the suggestions guys - most likely I'll stick to hibernate as
this gives me central control over how my users are represented and
used.
Currently there are not too many people registered on our server, but
we're looking at rollout in large numbers once we're past the test
stages - so I'll need to figure out how Hibernate works with this type
of query in the long run.
Thanks again!
-----Original Message-----
From: Jason Koeninger [mailto:jkoenin@jjcc.com]
Sent: 11 May 2006 16:13
To: xwiki-users(a)objectweb.org
Subject: Re: [xwiki-users] Joining two fields;
I'm no HQL expert, but I'm guessing you can do something like this:
select
firstname.value || ' ' || lastname.value from
BaseObject obj,
StringProperty firstname,
StringProperty lastname
where
obj.className='XWiki.XWikiUsers' and
firstname.id=obj.id and
firstname.name = 'first_name' and
lastname.id = obj.id and
lastname.name = 'last_name'
Untested so you may have to play around with it to get it to work.
Hopefully I'm not too far off the mark.
Also, depending on how your database's query optimizer works, a join
might perform better. Of course, that also depends on how Hibernate
translates the HQL to SQL. Hibernate *may* be smart enough to convert
this to a join in which case it's a non-issue.
Best Regards,
Jason Koeninger
J&J Computer Consulting
Mark Robinson wrote:
> Hi Brandon.
>
> No doubt there is a simple and elegant answer to your problem that
> someone will suggest soon. I worked around a similar problem that I
> needed to fix quickly by making the select straight html with a
> Velocity loop over the the option tags.
>
> That way you can still have your names and values as described.
>
> Cheers,
>
> Mark
>
>
> On 11 May 2006, at 5:50 PM, Esbach, Brandon wrote:
>
>> Hi all,
>>
>> I guess this is more a hibernate query than an Xwiki one, but here is
>> what I'm trying to do:
>> We use a simple project management class currently to keep track of
>> projects/engineer assignments/etc - currently managers type in
>> freeform names... as you could imagine this is a bit of a problem
with
>> adding some more active content relating to the user (we're adding a
>> 'workdesk' feature on login so that engineers/managers can see what
>> projects/tasks/etc are assigned to them, without having to browse
>> around and search).
>>
>> What I thought of doing was adding a dropdown with the user details -
>> allowing me to create a solid link between user and project.
>>
>> Now here's the problem...
>> I need to associate the firstname+lastname in the query - so that the
>> manager/etc will pick a name they recognise immediately, instead of
>> relying on them to know login names.
>>
>> Initially, I had thought to use a Map or List to request multiple
>> fields - but this does not seem to be understood by the renderer when
>> it creates a list dropdown - I get immediate errors
>>
>> Getting first name, no problem:
>> select prop.value from BaseObject obj, StringProperty prop where
>> obj.className='XWiki.XWikiUsers' and prop.id.id=obj.id and
>> prop.name='first_name'
>>
>> EG output in the list:
>> 'Brandon'
>> 'UserXFirstName'
>>
>> Getting Last name, also no problem:
>> select prop.value from BaseObject obj, StringProperty prop where
>> obj.className='XWiki.XWikiUsers' and prop.id.id=obj.id and
>> prop.name='last_name'
>>
>> EG output:
>> 'Esbach'
>> 'UserXLastName'
>>
>> Now it gets sticky. Join the two fields with a space between them,
>> so that instead of 'Brandon' or 'Esbach' I get 'Brandon Esbach'..
>> This I cannot seem to figure out using Hibernate, so any
>> hints/tips/suggestions would be appreciated.
>>
>>
>> *Problem number 2:*
>> Another small catch I have is mapping this entry so that I can query
>> on it. Normally with data representation one would have a 'display'
>> value and a 'link' value - kind of like the 'pretty name' and 'real
>> name' facility of class objects; only the 'pretty name' gets shown
>> when using automatic rendering - but the field is updated based on
>> 'real name'. Erm. Hope that makes sense.
>>
>> eg if my Xwiki name is braesb, firstname Brandon, lastname Esbach I
>> could have a list looking like this:
>> 'Brandon Esbach'
>> 'UserXFirstName UserXLastName'
>> Selecting 'Brandon Esbach' would then look to my 'link' value of
>> Xwiki.braesb, and store this with the record. Querying on this then
>> becomes no problem - but can this be done in Xwiki?
>>
>> /Brandon Esbach/
>> /Software Engineer/
>> /M/A-Com Eurotec Operations/
>> /LoughMahon Technology Park,/
>> /Skehard Road,/
>> /Blackrock,/
>> /Cork, Ireland/
>> /Tel +353 21 4808305/
>>
>>
>> --
>> You receive this message as a subscriber of the
>> xwiki-users(a)objectweb.org <mailto:xwiki-users@objectweb.org> mailing
list.
>> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
>> For general help: mailto:sympa@objectweb.org?subject=help
>> ObjectWeb mailing lists service home page:
>> http://www.objectweb.org/wws
>
>
>
> ----------------------------------------------------------------------
> --
>
>
> --
> You receive this message as a subscriber of the
xwiki-users(a)objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
Hi all,
I guess this is more a hibernate query than an Xwiki one, but here is
what I'm trying to do:
We use a simple project management class currently to keep track of
projects/engineer assignments/etc - currently managers type in freeform
names... as you could imagine this is a bit of a problem with adding
some more active content relating to the user (we're adding a 'workdesk'
feature on login so that engineers/managers can see what
projects/tasks/etc are assigned to them, without having to browse around
and search).
What I thought of doing was adding a dropdown with the user details -
allowing me to create a solid link between user and project.
Now here's the problem...
I need to associate the firstname+lastname in the query - so that the
manager/etc will pick a name they recognise immediately, instead of
relying on them to know login names.
Initially, I had thought to use a Map or List to request multiple fields
- but this does not seem to be understood by the renderer when it
creates a list dropdown - I get immediate errors
Getting first name, no problem:
select prop.value from BaseObject obj, StringProperty prop where
obj.className='XWiki.XWikiUsers' and prop.id.id=obj.id and
prop.name='first_name'
EG output in the list:
'Brandon'
'UserXFirstName'
Getting Last name, also no problem:
select prop.value from BaseObject obj, StringProperty prop where
obj.className='XWiki.XWikiUsers' and prop.id.id=obj.id and
prop.name='last_name'
EG output:
'Esbach'
'UserXLastName'
Now it gets sticky. Join the two fields with a space between them, so
that instead of 'Brandon' or 'Esbach' I get 'Brandon Esbach'.. This I
cannot seem to figure out using Hibernate, so any hints/tips/suggestions
would be appreciated.
Problem number 2:
Another small catch I have is mapping this entry so that I can query on
it. Normally with data representation one would have a 'display' value
and a 'link' value - kind of like the 'pretty name' and 'real name'
facility of class objects; only the 'pretty name' gets shown when using
automatic rendering - but the field is updated based on 'real name'.
Erm. Hope that makes sense.
eg if my Xwiki name is braesb, firstname Brandon, lastname Esbach I
could have a list looking like this:
'Brandon Esbach'
'UserXFirstName UserXLastName'
Selecting 'Brandon Esbach' would then look to my 'link' value of
Xwiki.braesb, and store this with the record. Querying on this then
becomes no problem - but can this be done in Xwiki?
Brandon Esbach
Software Engineer
M/A-Com Eurotec Operations
LoughMahon Technology Park,
Skehard Road,
Blackrock,
Cork, Ireland
Tel +353 21 4808305
When I am viewing pages (as opposed to editing pages), I wish to display a
two-pane view (the left hand nav and the main content area) and remove the
right hand piece.
When I am editing a page, I want to have the right hand explanatory text on
xwiki notation.
How can I do this?
I'm using 0.9.840 on Jboss if it matters.
--
Adrian Hall
Sr. Product Line Manager, Administration and Identity Management
e. ahall(a)mirapoint.com; t. +1 (408) 720-3856; c. +1 (408) 667-4977
I cannot get to http://www.xwiki.com or my xwiki site...I can get everywhere
else on the web. Does xwiki go down often? I am a little concerned about
availability of my xwiki site.
Thanks,
Brian