$rootCollection->setVisible(1)->store();
        $institutesRole->store();
    }
    $instituteCollection = $rootCollection->addLastChild();
    $instituteCollection->setVisible(1)->setName(randString($counter++))->store();
}
$doc->addCollection($instituteCollection);
//
// Identifiers
//
$oldOpusId = $doc->addIdentifierOpus3();
$oldOpusId->setValue(randString($counter++));
// empty URN will be automaticaly replace by new URN.
$urn = $doc->addIdentifierUrn();
$urn->setValue('urn:nbn:de:kobv:nn-opus-173:' . randString($counter++));
$isbn = $doc->addIdentifierIsbn();
$isbn->setValue('978-3-86680-192-9');
$issn = $doc->addIdentifierIssn();
$issn->setValue('1234-5678');
$doc->addIdentifierOpac()->setValue(randString($counter++));
//
// DnbInstitutes
//
$dnbInstitute = new Opus_DnbInstitute();
$dnbInstitute->setName(randString($counter++) . rand())->setAddress(randString($counter++))->setCity(randString($counter++))->setPhone(randString($counter++))->setDnbContactId(randString($counter++))->setIsGrantor(1)->store();
$doc->setThesisGrantor($dnbInstitute);
$doc->setThesisPublisher($dnbInstitute);
//
// Subjects
//
$doc->addSubject()->setType('swd')->setValue(randString($counter++));