use of org.bimserver.client.BimServerClient in project BIMserver by opensourceBIM.
the class TestListActivity method test.
@Test
public void test() throws Exception {
try (JsonBimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080")) {
try (BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"))) {
SServerInfo serverInfo = client.getAdminInterface().getServerInfo();
Map<Date, SRevision> revisions = new TreeMap<>();
for (SProject sProject : client.getServiceInterface().getAllProjects(true, true)) {
for (Long roid : sProject.getRevisions()) {
SRevision revision = client.getServiceInterface().getRevision(roid);
Date date = revision.getDate();
revisions.put(date, revision);
}
}
DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd hh:mm");
for (SRevision revision : revisions.values()) {
System.out.println(dateFormatter.format(revision.getDate()) + " " + revision.getComment());
}
}
}
Thread.sleep(1000);
}
use of org.bimserver.client.BimServerClient in project BIMserver by opensourceBIM.
the class TestSimultaneousCheckin method test.
@Test
public void test() throws Exception {
try (JsonBimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080")) {
try (BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"))) {
SProject project = client.getServiceInterface().addProject(RandomStringUtils.randomAlphanumeric(10), "ifc2x3tc1");
SDeserializerPluginConfiguration deserializer = client.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
Path path = Paths.get("../../TestFiles/TestData/data/export1.ifc");
client.checkinSync(project.getOid(), "test", deserializer.getOid(), path, new CheckinProgressHandler() {
@Override
public void progress(String title, int progress) {
System.out.println(title + ": " + progress);
}
});
}
Thread.sleep(1000);
}
}
Aggregations