I have an issue with the working of API call $isUserInGroup.
Imagine the group Employees consisting of two subgroups: Drones and
Management. Each employee is in one of those groups. When a space has
view rights for Employees, members of both groups have access.
When I check ($xwiki.user.isUserInGroup('XWiki.Employees') however for
a manager, I get a negative response, because the user is not in the
group XWiki.Employees.
My work-around: create a page/space where Employees has access to, and
use this call: $xwiki.hasAccessLevel("view", $context.user,
"Intranet.WebHome")
Hope this helps those who don't understand why the call is giving a
negative result ;)
Kind regards, Joris
Hello list,
In /etc/xwiki/xwiki.cfg I modified
* xwiki.defaultWeb
* xwiki.defaultPage
* and xwiki.showviewaction,
but none of them has been applied after I restarted tomcat?
Anyone else got similar issues on Ubuntu (12.04 LTS)?
Do I have to trigger something else to apply it?
Best regards
Florian
The XWiki Development Team is pleased to announce the release of XWiki Enterprise 4.1 Milestone 2.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
This is the second and final milestone of the XWiki Enterprise 4.1 development cycle.
Changes from Milestone 1:
* Extension Manager now handles updates to configuration documents.
* New localization through timezone settings.
* Customization of chart colors.
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWikiEnterpris…
Thanks,
The XWiki Development Team
Hi,
I've create a app with the App within Minutes;
The following class model is used:
- Name (name: String)
- E-mail (email: String)
- Subject (subject: String)
- Status (status: String)
- Question (question: TextArea)
- Answer (answer: TextArea)
- Published to Public (generalize: Static List)
So now when user click on 'Add' he/she is requested with document name and
then he/she can fill in the record
Now I would like to modify the behaviour?
1) Click on Add should not ask for new document name but for 'subject',
this should also show on the record prefilled
(I would like to generate a document name base on UserName + Subject)
2) Some fields should be defaulted by code
- name should be username, field should be hidden
- E-mail should be fetched from user record (XWiki.<username>.email)
- Subject (as stated under 1)
- Status should be defaulted to 'created'
- Published to Public should be defaulted to 'no'
How would you advise me to do this, i have modest velocity knowledge, but
no groovy, it looks like the code behind the 'add'-button is 'groovy'
Gerritjan
Uploading of files (XAR-files as well as i.e. JPG files) fails in 3.5 as well
as in 4.0. I try to upload an attachment but nothing happens. Log says:
"WARN o.x.v.i.DefaultVelocityEngine - Deprecated usage of method
[com.xpn.xwiki.api.XWiki.getXMLEncoded] in xwiki:XWiki.Import@2,42 ".
I'm staying at 4.0 since 4.1 refuses to upgrade (Oracle 11g) database. I'm
using Glassfish on Windows. I have the same error on 3.5, Glassfish on
Linux. What could possibly be wrong?
--
View this message in context: http://xwiki.475771.n2.nabble.com/Upload-does-not-work-tp7579277.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hello,
I'm wondering if I'm on the good path ...
I'm trying to move out some "old core" api usage, and replace them
using the DocumentAccessBridge (3.5.1), in a java component.
Considering a very simple use-case : setting property value of an
object. Here the document containing object is not in same space as
the class.
1- With old core:
XWikiDocument doc = context.getWiki().getDocument("Prefs.Document", context);
BaseObject obj = serverDoc.getObject("Code.Class");
obj.set("property", value, context);
2- With DAB, using deprecated method:
dab.setProperty("Prefs.Document", "Code.Class", "property", value);
3- With DAB, using non-deprecated methods:
SpaceReference prefsSpaceRef = new SpaceReference(new
EntityReference("Prefs", EntityType.SPACE));
DocumentReference prefsDocRef = new DocumentReference("Document",
prefsSpaceRef);
SpaceReference codeSpaceRef = new SpaceReference(new
EntityReference("Code", EntityType.SPACE));
DocumentReference classDocRef = new DocumentReference("Class",
codeSpaceRef);
dab.setProperty(prefsDocRef, classDocRef, "property", value);
Questions:
a- the code with 3- is, IMO, quite verbose compared to the others. Is
it really the best way to do this ? Of course I could store the
SpaceReference objects to factorize their use and simplify the code.
I'd better be sure before recoding all this ...
b- what's the best practice, for a component, to properly manage the
targeted wiki, in order to be single/multi-wiki/workspaces proof ?
Here I didn't bother specifying the targeted wiki, if I do it will add
more "*Reference" creations.
c- is there any facility method to convert an oldish xwiki document
reference (as "wiki:Space.Page" or "Space.Page") to a
DocumentReference ?
By the way, is the bridge API representative of the future new xwiki
data model that will replace old core, or is it only representative of
the current bridge api ?
Thanks,
Jeremie
Hi!
We do need to organize tasks concerning XWiki in our small group. We have not people expert enough in using XWiki as per trusting them by using Admin rights to edit XWiki users content.
Please, how could be trust edition rights to a small group of users to allow them edit information about users? Perhaps any way of trusting them access only to a given user?
Thanks!
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.
Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.
See more languages: http://www.sergas.es/aviso_confidencialidad.htm
Hello everyone,
I'm trying to send an automatic email and this is the idea I have had.
I used the "Groovy Notification Tutorial"
(http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial)
and instead of writing in a file, I try to send an email.
This is my code (I only copy the method onEvent, I didn't change the rest) :
void onEvent(Event event, Object source, Object data)
{
// Prevent infinite recursion since in this example we log to wiki
page which
// triggers a document change... :)
if (source.fullName != "Main.Logger") {
def sender = context.user.substring(6)
def emailcc = xwiki.null
def emailbcc = xwiki.null
def pageattachments = []
def emailcontent = "Test"
def result = xwiki.mailsender.sendHtmlMessage("${sender}",
"name(a)gmail.com", emailcc, emailbcc, "Test du mail", emailcontent,
document.getContent(), pageattachments)
def document = xwiki.getDocument("Main.Logger")
document.setContent("Sender : ${sender} / Content :
${emailcontent}")
document.save("Logging event", true)
}
}
But when I try this, nothing happened. I don't have any error message so I
don't know if I make something wrong.
Do you have an idea of how doing this ?
Thank you very much for your future answer,
Stéphanie
--
View this message in context: http://xwiki.475771.n2.nabble.com/Send-an-email-in-an-event-listener-tp7579…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I am writing a macro that performs a relatively expensive calculation
to generate content for display (a PNG image) based on user input. The
basic macro works fine, but I'd like to cache the generated content to
save recalculating it when I don't need to.
My idea is that I generate a SHA1 digest of the macro content, and
persistently cache the output generated for that input. I'm thinking
of using an LRU cache to avoid keeping massive amounts of data that'll
never get used again. The question I have is where I can put the cache
so that it is saved with the page, and I can access and update it from
the macro code. I suspect that the answer is to attach an object to
the page somehow, but I've been looking round the documentation and
can't find any examples of how I might do this (TBH, I'm struggling to
find my way round the documentation, so it may be that I've missed
something obvious - if so, then by all means point me to the right
place :-))
As the object is a PNG image, I'm currently base64-encoding it, and
using a data URL to display it. But if it's possible to cache the data
in such a way that the raw data is (or can be made) directly
addressible via a URL, that would be even better.
Can anyone help?
Thanks,
Paul.