Hi Developers,
i have been trying this the whole time already and decided to ask for help.
I want to create a space, a group and add a member to the group. The space
should only be viewed by this group.
Here is my code till now. The Space is created, the group too and the user
login in is added to the group. I can't figure how to assign the rights.
The CODE:
protected void addUserToGroup(String xwikiname, XWikiContext context)
throws XWikiException{
//
// Create a group and add the user to the newly created group.
BaseClass groupClass = context.getWiki().getGroupClass(context);
// Get document representing group
DocumentReference groupDocumentReference = new DocumentReference(
context.getDatabase(), "myspace",
"Testgroup");
XWikiDocument groupDoc = context.getWiki().getDocument(
groupDocumentReference, context);
BaseClass rightsClass = context.getWiki().getRightsClass(context);
if (groupDoc.isNew()) {
log.error("Creating Test group");
synchronized (groupDoc) {
// Add a member object to document
BaseObject memberObj = groupDoc.newXObject(
groupClass.getDocumentReference(), context);
memberObj.setStringValue("member", xwikiname);
BaseObject rights=
groupDoc.newXObject(rightsClass.getDocumentReference(),context);
rights.setStringValue("groups", "Testgroup");
rights.setStringValue("levels","view");
rights.setStringValue("levels", "edit");
rights.setStringValue("users", "");
rights.setIntValue("allow",1);
//groupDoc.getObject("XWiki.XWikiGlobalRights");
groupDoc.setSyntax(Syntax.XWIKI_2_1);
groupDoc.setContent("{{include
document='XWiki.XWikiGroupSheet' /}}");
// Save modifications
context.getWiki().saveDocument(groupDoc, context);
}
log.error("Added user"+ xwikiname +"to Testgroup");
}
}
Thanks for any help.
Hello all,
Could a kind admin please have a look at selfbus.myxwiki.org?
The wiki again takes 15-20 seconds to show a page. It is not as
bad as it was when the database migration was running, but it
is still barely usable.
The other strange thing is that every time an admin logs in
the upgrade wizard starts. The upgrade finishes without errors
or anything to migrate. Next time it shows up again. This is not
such a problem as one can choose to not show the wizard.
I only wanted to report the issue - maybe it's of interest for the
xwiki developers why this happens.
Thanks in advance and have a nice easter weekend,
Stefan
Hello,
I can only find one suggestion about migrating between databases, it's from
2006 that refers to an export tool that only works in Firefox.
Is there a better way yet? I've got quite a lot of content and users and
more importantly than the volume of data I'd like to retain "ownership"
metadata and history etc..
But then read a bit about it and thought "Do I need to migrate". I'm
assuming if the wiki is not being accessed then a simple filesystem backup
will be consistent and recoverable?
Should there be any extra indexes or anything else to do for performance
tweaks?
Would MySQL give me any advantage over HSQLDB?
(I'm on 5.0.3 and want to update to 5.4.4 soon.)
I distrust a database if I haven't got a whole pile of command line tools I
can poke at it with...
Max
--
View this message in context: http://xwiki.475771.n2.nabble.com/Migrating-from-HSQLDB-to-MySQL-tp7590158.…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi,
It is mentioned in the documentation "Give all privileges to the xwiki
user for accessing and creating databases" - because the user to be able
to create additional databases for sub-wikis ; but isn't it a little
pushy to give *all* the privileges (Grant, reload...) to the xwiki user ?
How could I secure the xwiki mysql user account a little more ?
Hi,
After installing latest version, a new space was created named File manager
Application
When i click on it
I am getting a strange page title, is it supposed to be like this ?
$services.localization.render('platform.appwithinminutes.appHomePageTitle',
$services.localization.render("filemanager.appname"))
Thanks,
--
*BHY*
Hello all,
Could a kind admin please have a look at selfbus.myxwiki.org?
The wiki takes several seconds (rather minutes) to show a page.
Thanks in advance,
Stefan
Can someone please reproduce these steps?
First prepare 2 documents for upload. Let's say 2 MSWord documents, A.doc
and B.doc.
1) Create a new page, enter some text
2) Upload A.doc
3) Remove A.doc
4) Upload B.doc
5) Activate the version where you uploaded A.doc (should be version 2.1)
6) Delete the latest version of the page (this *should* take you back to
version 4.1 where you uploaded B.doc)
Examine the attachments page:
It will show A.doc and B.doc (which in my opinion is strange, because I
would expect to only find B.doc).
Try to open A.doc (this is possible), now try to open B.doc (this is NOT
possible).
--
View this message in context: http://xwiki.475771.n2.nabble.com/BUG-Do-the-attachments-hustle-tp7589936.h…
Sent from the XWiki- Users mailing list archive at Nabble.com.