add change_rights/onEvent.java groovy script
This commit is contained in:
commit
c79407ecd7
23
change_rights/onEvent.java
Normal file
23
change_rights/onEvent.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import org.xwiki.bridge.event.*
|
||||||
|
import org.xwiki.model.reference.*
|
||||||
|
import org.xwiki.model.*
|
||||||
|
|
||||||
|
try {
|
||||||
|
def docSource = xcontext.method.input.get(1)
|
||||||
|
def context = xcontext.method.input.get(2)
|
||||||
|
def xwiki = context.getWiki()
|
||||||
|
def document = xwiki.getDocument(docSource, context)
|
||||||
|
def parent = xwiki.getDocument(document.getParent(), context)
|
||||||
|
|
||||||
|
def userRef = new DocumentReference("xwiki", "XWiki", "ProtokollDummy")
|
||||||
|
document.setCreatorReference(userRef)
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println(userRef)
|
||||||
|
System.out.println(document.getCreatorReference())
|
||||||
|
|
||||||
|
|
||||||
|
} catch(e) {
|
||||||
|
System.out.println("ERROR!")
|
||||||
|
System.out.println(e.getMessage())
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user