Search in sources :

Example 1 with SRevisionComparator

use of org.bimserver.webservices.SRevisionComparator in project BIMserver by opensourceBIM.

the class ServiceImpl method getAllRevisionsByUser.

@Override
public List<SRevision> getAllRevisionsByUser(Long uoid) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<Set<Revision>> action = new GetAllRevisionsByUserDatabaseAction(session, getInternalAccessMethod(), uoid);
        List<SRevision> convertToSListRevision = getBimServer().getSConverter().convertToSListRevision(session.executeAndCommitAction(action));
        Collections.sort(convertToSListRevision, new SRevisionComparator(true));
        return convertToSListRevision;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SRevision(org.bimserver.interfaces.objects.SRevision) Set(java.util.Set) LinkedHashSet(java.util.LinkedHashSet) DatabaseSession(org.bimserver.database.DatabaseSession) GetAllRevisionsByUserDatabaseAction(org.bimserver.database.actions.GetAllRevisionsByUserDatabaseAction) IOException(java.io.IOException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) SerializerException(org.bimserver.plugins.serializers.SerializerException) BcfException(org.opensourcebim.bcf.BcfException) UserException(org.bimserver.shared.exceptions.UserException) CannotBeScheduledException(org.bimserver.longaction.CannotBeScheduledException) DeserializeException(org.bimserver.plugins.deserializers.DeserializeException) ServerException(org.bimserver.shared.exceptions.ServerException) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException) SRevisionComparator(org.bimserver.webservices.SRevisionComparator)

Example 2 with SRevisionComparator

use of org.bimserver.webservices.SRevisionComparator in project BIMserver by opensourceBIM.

the class ServiceImpl method getAllRevisionsOfProject.

@Override
public List<SRevision> getAllRevisionsOfProject(Long poid) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<Set<Revision>> action = new GetAllRevisionsOfProjectDatabaseAction(session, getInternalAccessMethod(), poid);
        List<SRevision> convertToSListRevision = getBimServer().getSConverter().convertToSListRevision(session.executeAndCommitAction(action));
        Collections.sort(convertToSListRevision, new SRevisionComparator(true));
        return convertToSListRevision;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SRevision(org.bimserver.interfaces.objects.SRevision) Set(java.util.Set) LinkedHashSet(java.util.LinkedHashSet) DatabaseSession(org.bimserver.database.DatabaseSession) GetAllRevisionsOfProjectDatabaseAction(org.bimserver.database.actions.GetAllRevisionsOfProjectDatabaseAction) IOException(java.io.IOException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) SerializerException(org.bimserver.plugins.serializers.SerializerException) BcfException(org.opensourcebim.bcf.BcfException) UserException(org.bimserver.shared.exceptions.UserException) CannotBeScheduledException(org.bimserver.longaction.CannotBeScheduledException) DeserializeException(org.bimserver.plugins.deserializers.DeserializeException) ServerException(org.bimserver.shared.exceptions.ServerException) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException) SRevisionComparator(org.bimserver.webservices.SRevisionComparator)

Aggregations

IOException (java.io.IOException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 MalformedURLException (java.net.MalformedURLException)2 LinkedHashSet (java.util.LinkedHashSet)2 Set (java.util.Set)2 MessagingException (javax.mail.MessagingException)2 AddressException (javax.mail.internet.AddressException)2 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)2 DatabaseSession (org.bimserver.database.DatabaseSession)2 SRevision (org.bimserver.interfaces.objects.SRevision)2 CannotBeScheduledException (org.bimserver.longaction.CannotBeScheduledException)2 DeserializeException (org.bimserver.plugins.deserializers.DeserializeException)2 SerializerException (org.bimserver.plugins.serializers.SerializerException)2 ServerException (org.bimserver.shared.exceptions.ServerException)2 UserException (org.bimserver.shared.exceptions.UserException)2 SRevisionComparator (org.bimserver.webservices.SRevisionComparator)2 BcfException (org.opensourcebim.bcf.BcfException)2 GetAllRevisionsByUserDatabaseAction (org.bimserver.database.actions.GetAllRevisionsByUserDatabaseAction)1 GetAllRevisionsOfProjectDatabaseAction (org.bimserver.database.actions.GetAllRevisionsOfProjectDatabaseAction)1