use of cbit.vcell.modeldb.PublicationRep in project vcell by virtualcell.
the class PublicationsServerResource method getPublicationRepresentations.
private PublicationRepresentation[] getPublicationRepresentations(User vcellUser) {
ArrayList<PublicationRepresentation> publicationRepresentations = new ArrayList<PublicationRepresentation>();
RestDatabaseService restDatabaseService = ((VCellApiApplication) getApplication()).getRestDatabaseService();
try {
PublicationRep[] publicationReps = restDatabaseService.query(this, vcellUser);
for (PublicationRep publicationRep : publicationReps) {
PublicationRepresentation publicationRepresentation = new PublicationRepresentation(publicationRep);
publicationRepresentations.add(publicationRepresentation);
}
} catch (PermissionException ee) {
ee.printStackTrace();
throw new ResourceException(Status.CLIENT_ERROR_UNAUTHORIZED, "not authorized");
} catch (DataAccessException | SQLException | ExpressionException e) {
e.printStackTrace();
throw new RuntimeException("failed to retrieve biomodels from VCell Database : " + e.getMessage());
}
return publicationRepresentations.toArray(new PublicationRepresentation[0]);
}
Aggregations