Search in sources :

Example 36 with PublicInterfaceNotFoundException

use of org.bimserver.shared.exceptions.PublicInterfaceNotFoundException in project BIMserver by opensourceBIM.

the class RegenerateGeometry method start.

private void start() {
    try {
        BimServerClientInterface client = LocalDevSetup.setupJson("http://localhost:8080");
        List<SProject> allProjects = client.getServiceInterface().getAllProjects(false, true);
        Set<Long> croids = new HashSet<Long>();
        for (SProject project : allProjects) {
            for (Long roid : project.getRevisions()) {
                SRevision revision = client.getServiceInterface().getRevision(roid);
                for (long croid : revision.getConcreteRevisions()) {
                    croids.add(croid);
                }
            }
        }
        for (long croid : croids) {
            client.getAdminInterface().regenerateGeometry(croid);
        }
        System.out.println("Done");
    } catch (ServiceException e) {
        e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
        e.printStackTrace();
    }
}
Also used : SRevision(org.bimserver.interfaces.objects.SRevision) ServiceException(org.bimserver.shared.exceptions.ServiceException) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) BimServerClientInterface(org.bimserver.plugins.services.BimServerClientInterface) SProject(org.bimserver.interfaces.objects.SProject) HashSet(java.util.HashSet)

Example 37 with PublicInterfaceNotFoundException

use of org.bimserver.shared.exceptions.PublicInterfaceNotFoundException in project BIMserver by opensourceBIM.

the class TestUploadSameModelALot method start.

private void start() {
    try {
        BimServerClientInterface client = LocalDevSetup.setupJson("http://localhost:8080");
        client.getSettingsInterface().setGenerateGeometryOnCheckin(false);
        for (int i = 0; i < 20; i++) {
            SProject project = client.getServiceInterface().addProject("P" + i, "ifc2x3tc1");
            SDeserializerPluginConfiguration deserializerForExtension = client.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
            System.out.println(i);
            client.checkin(project.getOid(), "C" + i, deserializerForExtension.getOid(), false, Flow.SYNC, Paths.get("../TestData/data/AC11-FZK-Haus-IFC.ifc"));
        }
    } catch (ServiceException e) {
        e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) ServiceException(org.bimserver.shared.exceptions.ServiceException) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) BimServerClientInterface(org.bimserver.plugins.services.BimServerClientInterface) IOException(java.io.IOException) SProject(org.bimserver.interfaces.objects.SProject)

Example 38 with PublicInterfaceNotFoundException

use of org.bimserver.shared.exceptions.PublicInterfaceNotFoundException in project BIMserver by opensourceBIM.

the class Tmp method main.

public static void main(String[] args) {
    BimServerClientInterface bimServerClient = LocalDevSetup.setupJson("http://localhost:8080");
    // Create a project
    try {
        SProject project = bimServerClient.getServiceInterface().addProject("test" + Math.random(), "ifc2x3tc1");
        // Look for a deserializer
        SDeserializerPluginConfiguration deserializer = bimServerClient.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
        // Checkin file
        bimServerClient.checkin(project.getOid(), "test", deserializer.getOid(), false, Flow.SYNC, Paths.get("../TestData/data/AC11-Institute-Var-2-IFC.ifc"));
        // Refresh project
        project = bimServerClient.getServiceInterface().getProjectByPoid(project.getOid());
        // Load model without lazy loading (complete model at once)
        IfcModelInterface model = bimServerClient.getModel(project, project.getLastRevisionId(), false, false);
        System.out.println(model.getAllWithSubTypes(IfcWall.class).size());
    } catch (ServerException | UserException | PublicInterfaceNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (BimServerClientException e) {
        e.printStackTrace();
    }
}
Also used : SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) ServerException(org.bimserver.shared.exceptions.ServerException) IfcModelInterface(org.bimserver.emf.IfcModelInterface) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) BimServerClientInterface(org.bimserver.plugins.services.BimServerClientInterface) UserException(org.bimserver.shared.exceptions.UserException) IOException(java.io.IOException) SProject(org.bimserver.interfaces.objects.SProject) BimServerClientException(org.bimserver.shared.exceptions.BimServerClientException)

Aggregations

PublicInterfaceNotFoundException (org.bimserver.shared.exceptions.PublicInterfaceNotFoundException)38 SProject (org.bimserver.interfaces.objects.SProject)22 BimServerClientInterface (org.bimserver.plugins.services.BimServerClientInterface)20 ServiceException (org.bimserver.shared.exceptions.ServiceException)20 IOException (java.io.IOException)19 ServerException (org.bimserver.shared.exceptions.ServerException)18 UserException (org.bimserver.shared.exceptions.UserException)18 BimServerClientException (org.bimserver.shared.exceptions.BimServerClientException)15 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)12 SSerializerPluginConfiguration (org.bimserver.interfaces.objects.SSerializerPluginConfiguration)10 Path (java.nio.file.Path)9 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)8 JsonBimServerClientFactory (org.bimserver.client.json.JsonBimServerClientFactory)7 ChannelConnectionException (org.bimserver.shared.ChannelConnectionException)6 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)4 IfcModelInterface (org.bimserver.emf.IfcModelInterface)4 FileNotFoundException (java.io.FileNotFoundException)3 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3