Search in sources :

Example 1 with AddProjectDatabaseAction

use of org.bimserver.database.actions.AddProjectDatabaseAction in project BIMserver by opensourceBIM.

the class ServiceImpl method addProjectAsSubProject.

@Override
public SProject addProjectAsSubProject(String projectName, Long parentPoid, String schema) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<Project> action = new AddProjectDatabaseAction(getBimServer(), session, getInternalAccessMethod(), projectName, parentPoid, schema, getAuthorization());
        return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : Project(org.bimserver.models.store.Project) SProject(org.bimserver.interfaces.objects.SProject) DatabaseSession(org.bimserver.database.DatabaseSession) AddProjectDatabaseAction(org.bimserver.database.actions.AddProjectDatabaseAction) 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)

Example 2 with AddProjectDatabaseAction

use of org.bimserver.database.actions.AddProjectDatabaseAction in project BIMserver by opensourceBIM.

the class ServiceImpl method addProject.

@Override
public SProject addProject(String projectName, String schema) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<Project> action = new AddProjectDatabaseAction(getBimServer(), session, getInternalAccessMethod(), projectName, schema, getAuthorization());
        return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : Project(org.bimserver.models.store.Project) SProject(org.bimserver.interfaces.objects.SProject) DatabaseSession(org.bimserver.database.DatabaseSession) AddProjectDatabaseAction(org.bimserver.database.actions.AddProjectDatabaseAction) 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)

Aggregations

IOException (java.io.IOException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 MalformedURLException (java.net.MalformedURLException)2 MessagingException (javax.mail.MessagingException)2 AddressException (javax.mail.internet.AddressException)2 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)2 DatabaseSession (org.bimserver.database.DatabaseSession)2 AddProjectDatabaseAction (org.bimserver.database.actions.AddProjectDatabaseAction)2 SProject (org.bimserver.interfaces.objects.SProject)2 CannotBeScheduledException (org.bimserver.longaction.CannotBeScheduledException)2 Project (org.bimserver.models.store.Project)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 BcfException (org.opensourcebim.bcf.BcfException)2