23 lines
617 B
Java
23 lines
617 B
Java
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())
|
|
} |