Search in sources :

Example 1 with DefaultTestDocument

use of org.xwiki.security.authorization.testwikis.internal.entities.DefaultTestDocument in project xwiki-platform by xwiki.

the class TestDocumentFactory method getNewInstance.

@Override
TestDocument getNewInstance(ElementParser parser, String name, TestEntity parent, Attributes attributes) {
    EntityReference reference = parser.getResolver().resolve(attributes.getValue("name"), DefaultTestDocument.TYPE, parent.getReference());
    String creatorString = attributes.getValue("creator");
    EntityReference creator = (creatorString) != null ? parser.getResolver().resolve(creatorString, DefaultTestDocument.TYPE, new EntityReference(XWikiConstants.XWIKI_SPACE, EntityType.SPACE, reference.getRoot())) : null;
    return new DefaultTestDocument(reference, creator, attributes.getValue("alt"), parent);
}
Also used : EntityReference(org.xwiki.model.reference.EntityReference) DefaultTestDocument(org.xwiki.security.authorization.testwikis.internal.entities.DefaultTestDocument)

Aggregations

EntityReference (org.xwiki.model.reference.EntityReference)1 DefaultTestDocument (org.xwiki.security.authorization.testwikis.internal.entities.DefaultTestDocument)1