Search in sources :

Example 1 with DefaultTestGroup

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

the class TestGroupUserFactory method getNewInstance.

@Override
TestGroup getNewInstance(ElementParser parser, String name, TestEntity parent, Attributes attributes) throws SAXException {
    EntityReference reference = parser.getResolver().resolve(attributes.getValue("name"), parent.getType(), parent.getReference());
    TestEntity entity = parser.getWikis().searchEntity(reference);
    if (entity == null) {
        throw new SAXException(parser.getLocatedMessage("User/Group [%s] is undefined.", reference));
    }
    new DefaultTestGroup(parser.getSerializer().serialize(parent.getReference()), parent.getReference(), entity);
    return null;
}
Also used : TestEntity(org.xwiki.security.authorization.testwikis.TestEntity) DefaultTestGroup(org.xwiki.security.authorization.testwikis.internal.entities.DefaultTestGroup) EntityReference(org.xwiki.model.reference.EntityReference) SAXException(org.xml.sax.SAXException)

Aggregations

SAXException (org.xml.sax.SAXException)1 EntityReference (org.xwiki.model.reference.EntityReference)1 TestEntity (org.xwiki.security.authorization.testwikis.TestEntity)1 DefaultTestGroup (org.xwiki.security.authorization.testwikis.internal.entities.DefaultTestGroup)1