use of org.bimserver.database.actions.AddNewServiceToProjectDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method addNewServiceToProject.
@Override
public Long addNewServiceToProject(Long poid, SNewService sService, SAction sAction) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
NewService service = (NewService) session.create(StorePackage.eINSTANCE.getNewService());
getBimServer().getSConverter().convertFromSObject(sService, service, session);
AddNewServiceToProjectDatabaseAction dbAction = new AddNewServiceToProjectDatabaseAction(session, getInternalAccessMethod(), poid, service, service.getAction(), getAuthorization());
return session.executeAndCommitAction(dbAction);
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations